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

Allow GTM override #44

Merged
merged 1 commit into from
Jul 18, 2015
Merged

Allow GTM override #44

merged 1 commit into from
Jul 18, 2015

Conversation

bmd
Copy link
Contributor

@bmd bmd commented Nov 2, 2014

I needed this fix for a recent project, so I thought it might be worth committing back.

While analytics is often implemented through GTM, this isn't necessarily the case, and the current version doesn't work on pages where GTM is included but doesn't implement GA.

Scrolldepth currently assumes that if GTM is on the page it is used to
implement Google Analytics. This does not have to be the case and
should be configurable.
@lkraav
Copy link

lkraav commented Nov 2, 2014

Yes, I believe I have this scenario as well and just heard a complaint. Will be testing this.

@robflaherty
Copy link
Owner

Thanks for catching this. I wonder if there's a way to do this without requiring a plugin option, i.e. is it possible to detect whether GA is implemented via GTM?

@bmd
Copy link
Contributor Author

bmd commented Nov 4, 2014

Not that I know of, unfortunately, or that would obviously be a better solution.

You could try to do some inferential stuff like checking whether there is onpage code for GA and whether GTM is also initialized on the page, but that will still create edge cases where you have a non-standard GA implementation if the best you can do is correlate the two.

@robflaherty robflaherty merged commit 1036745 into robflaherty:master Jul 18, 2015
@robflaherty
Copy link
Owner

@bmd Merged into master. Thanks again!

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.

3 participants