analytics
analytics copied to clipboard
fix: pre-installed gtag causes analytics.js plugin to not initialize
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.
also, let me know if you have a prettier config you want me to use.