Closed mnieber closed 7 years ago
I fixed it by removing connectToHistory and using:
let fireTracking = function() {
if (window.location) {
this.piwik.track(window.location);
}
}.bind(this)
return (
<Router history={browserHistory} onUpdate={fireTracking}>
// etc, etc
);
Yes, You're totally right! Thanks for reporting and looking into it. I'll figure out a solution at the weekend which will use your solution as the default inside connectToHistory
and a configuration option to disable it again.
I think i'll use history.location
to be consistent with the first attribute of the piwikReactRouter.track
function.
If I connect piwik and visit my website, nothing is reported to piwik. But when I click internal links on my page, then piwik shows me a new visit and action.
Could it be that piwik-react-router is only listening to changes, and not to the initial route?