Problem/Motivation
Hello, I have a feature request.
Google Tag Manager has recently added some new default triggers, the one that could be very useful in relation to this module is "Consent Initialization - All Pages"
Steps to reproduce
Set up a Tag in GTM with the trigger set to "Consent Initialization - All pages".
In GTM, click preview and load the page with the debugger.
GTM fires the tag before you click Accept or Don't Accept.
Proposed resolution
Add support to this module so that it reports back to GTM that consent has been given. (Is this possible?)
If we could add something to the community template gallery that would be fantastic.
https://support.google.com/tagmanager/answer/9454109?hl=en&ref_topic=300...
More info:
https://support.google.com/tagmanager/answer/10718549?hl=en
Nice blog post about the new consent mode:
https://www.simoahava.com/analytics/consent-settings-google-tag-manager/
Comments
Comment #2
svenryen commentedComment #3
jrbI'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
gtagscript 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
gtagwith this: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.
Comment #4
scott_euser commentedI 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 #3332626: Make the module compatible with Google Consent Mode is still work in progress there though.
Comment #5
damienmo commentedWhat you are describing in this issue is the normal behavior.
"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".
Comment #6
atowl commentedHi
This issue is tagged with version 2.
Since we are no longer releasing a version 2 i am closing this issue,
I wish to thank those who contribute their time to this issue