- πΊπΈUnited States jrb Raleigh-Durham Area, NC, USA
I've created a sandbox module that does this here:
https://www.drupal.org/sandbox/jrb/3433126 β
In order for this to work, the Google Tag Manager
gtag
script must be included on the page by some other method. This can be done with a custom script or with a module like Google Tag β .Just enable this module; and, when the user consents to cookies, it will call
gtag
with this:gtag('consent', 'update', { 'ad_user_data': 'granted', 'ad_personalization': 'granted', 'ad_storage': 'granted', 'analytics_storage': 'granted' });
Depending on what the maintainers of this module would like to do, this code could be folded into this module as a submodule or I could release it as a full module. Either way is OK with me.
- π¬π§United Kingdom scott_euser
I think probably this is the way to go? https://www.drupal.org/project/eu_cookie_compliance_gtm β which seems to connect the google_tag and eu_cookie_compliance modules. I did notice β¨ Make the module compatible with Google Consent Mode RTBC is still work in progress there though.
- π¨πSwitzerland DamienMo
What you are describing in this issue is the normal behavior.
GTM fires the tag before you click Accept or Don't Accept.
"Consent Initialization - All Pages" is supposed to be the first trigger to fire. It should be used to trigger a CookieBot Tag For example.
If you want your tag to be run after the consent has been given you should create a custom event trigger matching "cookie_consent_update".