analytics icon indicating copy to clipboard operation
analytics copied to clipboard

fix: pre-installed gtag causes analytics.js plugin to not initialize

Open kmclaugh opened this issue 3 years ago • 1 comments

It's very common for other gtags (from universal analytics, google ads, etc) to already be loaded before analytics.js loads gtag. Before this fix, they would cause analytics.js not to load gtag in the initialize function, thus preventing google analytics from firing.

This fix checks if OUR gtag is loaded already, instead of checking if any gtag is loaded.

kmclaugh avatar Aug 12 '22 15:08 kmclaugh

also, let me know if you have a prettier config you want me to use.

kmclaugh avatar Aug 12 '22 15:08 kmclaugh