GoogleAnalytics is called two times when page refresh


(Piotr Szal) #1

When I reload a page GoogleAnalytics is called two times. Here on meta.discourse.org too.

I think after the change to es6 the pageTracker.on(‘change’, function() is called on refresh the page and not only on move to other page.


(Jeff Atwood) #2

Ok, if it is an ES6 problem, @eviltrout should have a look.


(Robin Ward) #3

I’m not sure how ES6 broke this as I kept the initializer code the same as before. I did notice we are signaling a pageTrack in the HTML of the document as well as whenever Ember’s router transitions, so I removed it to only rely on Ember’s router. It should now only update once per reload.

Thanks


GoogleUniversalAnalytics Update is not called when GA is enabled
(Jeff Atwood) #4