function __gaTrackerOptout() ?
-
Hi
I see in my source code some functions related to G.A.optout but how are we supposed to use them?
Thanks
-
Hi there,
We have an example here: https://github.com/awesomemotive/google-analytics-for-wordpress/issues/488#issuecomment-286031166 and a full guide will be coming to our documentation later this year-Chris
Hi thanks for the answer, but it seems that MonsterInsights is stil using Analytics.js? But what about the new gtag.js? :
<!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-234217-21"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-XXXXXX-XX'); </script>Hi there,
I’m not sure what you mean by “is still using analytics.js” but gtag.js and analytics.js are 2 different things. Gtag.js is not a replacement for analytics.js (unlike for example how analytics.js was a replacement for ga.js). In fact, if you use Google Analytics inside of gtag.js, all it does is simply load analytics.js transform the events into that. Therefore, for the vast majority of our users, supporting gtag as opposed to analytics.js would not improve anything, it’d actually make things far worse. Consider that gtag.js’s file is unique to your server, so unlike analytics.js which is available on millions of websites and is cached on any standard web user’s browser, your gtag script wouldn’t be, so your users would now have to load a script unnecessarily (on top of the fact the entire gtag filesize, which is large compared to analytics.js would be essentially wasted). Bare in mind, gtag doesn’t even support all of analytics.js’s native features (like tasks or plugins) and doesn’t appear like they will any time soon (based on lack of autotrack support). Google even specifically recommends against using gtag.js unless you are using other Google services like Adwords (and since we only support GA, it doesn’t make sense to use gtag.js).The point of gtag is to make certain Google tag options easier to use and more uniform (with more JSON syntax use), but it’s not a replacement to the native functions of those services, the same way that Measurement Protocol isn’t a replacement to analytics.js. They serve 2 very different purposes.
If, and when, Google Analytics releases a new tracking JS file, we’ll be the first to support it (but bare in mind, even if Google introduced a new system, they keep supporting old ones, it’s not like they immediately break (Urchin.js, which was the precursor to ga.js (the precursor to analytics.js) from 10+ years ago is still being actively used on some sites)).
-Chris
Hi Chris and thanks for the great explanation 🙂
I was just asking you that because I read this below into my G.A. account:
The Global Site Tag provides streamlined tagging across Google’s site measurement, conversion tracking, and remarketing products – giving you better control while making implementation easier. By using gtag.js, you will be able to benefit from the latest dynamic features and integrations as they become available.
Global Site Tag (gtag.js) and Google Tag Manager are the recommended tracking methods for new implementations. Additional implementation options are also available including analytics.js and the Measurement Protocol.
The topic ‘function __gaTrackerOptout() ?’ is closed to new replies.