Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

'global' id in HTML tag causes analytics.js to fail badly #29

Closed
disruptek opened this issue Jan 12, 2017 · 4 comments
Closed

'global' id in HTML tag causes analytics.js to fail badly #29

disruptek opened this issue Jan 12, 2017 · 4 comments

Comments

@disruptek
Copy link

If you, as I do, have a page with, say, a <div id="global">...</div> then analytics.js will load and run via the snippet, but will not overwrite the window.analytics variable and playback the stubbed call queue. A call to page() will be made with the defaults, but that's the only sign that anything at all happened.

And, yes, this absolutely gave me fits while trying to debug...

@tsholmes
Copy link

tsholmes commented Jan 12, 2017

This is due to the lovely implicit id references and an issue in the insert-module-globals module that browserify uses to fill global references. would be fixed by browserify/insert-module-globals#48 if it ever merges. I can put in a workaround for this in our browserify process for analytics.js for now. I'll update you when its deployed

@disruptek
Copy link
Author

Thanks; that sounds better than an update to the docs. 😉

@tsholmes
Copy link

New version deployed. Let me know if its fixed for you

@disruptek
Copy link
Author

Sorry; worked around this and didn't bother to update the ticket. It appears fixed, thanks. 😄

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

No branches or pull requests

2 participants