Events are not assigned to the proper page.
Closed this issue · 2 comments
When sending events, they all get attributed to the same page regardless of the page the event was created on. I'm setting a prefix, and in my case it is always the prefix page.
I believe that the library needs to set the page
with the analytics api.
If the current page is sending other hits (like events), you'll want to make sure every hit gets sent with the correct URL.
https://developers.google.com/analytics/devguides/collection/analyticsjs/pages
Hey, I think this should be a bug rather than an enhancement. In my case I have a page #/catalogue
that correctly triggers on the routeChangeSuccess to /catalogue
in GA, but when on that page I call the following it logs the impressions to /
which messes up time on page and product views stats.
analytics.addImpression(...);
So this issue was found in the angulartics library as well, taking a hint from them I found this worked and allocates the correct page to the events:
$window.ga('send', 'event', 'scroll', 'impression', {page: $location.url(), 'nonInteraction': true});
Reference: http://www.phil-hudson.com/how-to-fix-angularitics-event-wrong-active-page-in-real-time-stats/