angulartics / angulartics-google-analytics

Google Analytics plugin for Angulartics
MIT License
133 stars 86 forks source link

Events not dispatched (not sended) if no navigation #101

Closed ddcovery closed 7 years ago

ddcovery commented 7 years ago

I'm trying to track an event when I'm into a controller. $analytics.eventTrack('myevent');

I'm using "angulartics.debug" and I can see in the console the corresponding "Event tracking: myevent undefined"

The problem is nothing is sended to google analytics.

If I navigate to an external web imediatelly after eventTrack (i.e.: $window.location="...."), then the "collect" call is performed to analytic.

This behaviour is completly different to my old 0.1.x versions, where each eventTrack was inmediatelly dispached as a XHR/Beacon/Image call to google analytics.

DanWilkerson commented 7 years ago

Are you sure that the event hit is being sent then? There's nothing in Angulartics that I can think of that could cause the behavior you're describing. However, the autoPageview feature would track a pageview when you switch routes, which may be what you're seeing?