What do you think about providing some option to not add the initial trackPageView on https://github.com/mike-spainhower/angular-piwik/blob/master/lib/angular-piwik.coffee#L176 ?
I've setup my app to call trackPageView whenever UI router notifies me about a state/url change, but this gives double counting from the initial page load, and I'd prefer not having to keep track of whether the state change is the first or not, it just seems messy.
Also, when setting the page title dynamically, the trackPageView from angular-piwik is sometimes called before I've had time to update the title. It would be better to have full control of when to call trackPageView.
I don't write coffee, but in plain js I'm thinking of something like this:
if (tAttrs.ngpTrackInitial !== false) {
return $window['_paq'].push(['trackPageView']);
}
return $window['_paq'];
What do you think about providing some option to not add the initial
trackPageViewon https://github.com/mike-spainhower/angular-piwik/blob/master/lib/angular-piwik.coffee#L176 ?I've setup my app to call
trackPageViewwhenever UI router notifies me about a state/url change, but this gives double counting from the initial page load, and I'd prefer not having to keep track of whether the state change is the first or not, it just seems messy.Also, when setting the page title dynamically, the
trackPageViewfrom angular-piwik is sometimes called before I've had time to update the title. It would be better to have full control of when to calltrackPageView.I don't write coffee, but in plain js I'm thinking of something like this: