- Status changed to Postponed: needs info
about 1 year ago 5:56pm 22 October 2023 - 🇳🇴Norway svenryen
I'm not the most experienced GTM/GA user, but I did set up an account at https://tagmanager.google.com/#/home and https://analytics.google.com/analytics/web/.
Best practice nowadays seems to be using the google_tag module, so I installed, enabled and configured that module to load my GTM tag.
Once that's set up and confirmed working, I set up my site to Opt-in users to tracking and listed the two scripts of the google_tag module in "Disable JavaScripts".
The value of the field is:
<blockquote>modules/contrib/google_tag/js/gtag.js modules/contrib/google_tag/js/gtm.js</blockquote>
I also tried the same setup with a category added to the mix:
<blockquote>analytics:modules/contrib/google_tag/js/gtag.js analytics:modules/contrib/google_tag/js/gtm.js</blockquote>
Loading that page in a few incognito windows demonstrates that there's no GA traffic recorded until the consent was given, and after it was given, the googletagmanager script loads and records my activity in GA4.
It seems this module doesn't create a sites/default/files/google_tag/google_tag.script.js file. Could you add some information as to what module provides that file? Is it possible to attempt using the google_tag module to achieve your desired outcome, or is there some feature google_tag lacks?