Closed craigbroadman closed 6 years ago
@craigbroadman
Although I don't see any version 0.17.2. I suspect that either you didn't add the Google Analytics tracker code or it's been loaded after Angulartics code. The problem is that the dispatchToGa
function is defined on the module's config phase and if for any reason the GA script is not loaded yet, then it won't do any action, never. In my opinion it should try to set the function again on every new dispatchToGa
call .
@craigbroadman try using the unminified file from this fork I've just done and let me know if that works for you. It actually fixed the use case I have in a project, where the analytics ID is received via an API, therefore the script is lazy loaded after the API call is done.
https://github.com/lucianosantana/angulartics-google-analytics/blob/master/lib/angulartics-ga.js
Do you think it makes sense @DanWilkerson . Asking you because it touches things you've done some time ago.
If so I'll submit a PR.
Go ahead and submit a PR and I'll take a look; definitely not a bad idea, and how I would have done it if I were here when the project started.
@DanWilkerson here is the PR https://github.com/angulartics/angulartics-google-analytics/pull/114 I've noticed there are some CI errors due to npm warning. Unrelated to the change I've made. In any case I'd say this should be fixed in a separate PR.
Thanks for the PR!
I am using the latest version of angulartics and the latest version of angulartics-google-analytics (downloaded via bower) and it isn't recording anything to google analytics.
If however I replace the angulartics-ga.min.js script with a previous version (0.17.2) it all works ok.
What am I missing?