Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added sanity check: is Google Analytics loaded? #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

harmenjanssen
Copy link

This is just a very small tweak that makes sure ga is actually defined before calling it.
Since Google Analytics is typically loaded asynchronously and sometimes even by Google Tag Manager which itself is loaded asynchronously, it's possible for ga to be late to the party.

This oughtta make sure we never call an undefined function.

By the way: I'm not sure why my dist version includes comments where yours doesn't. I built using the supplied Gruntfile in the main repo. If you have any idea how to fix that I'll gladly edit my pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant