If you want to ensure that a tag only loads after consent has been given, you can configure tag with Additional Consent Settings.
This is similar to setting conditions on a trigger, but in this case the condition is applied to the tag instead.
Tags that normally use the All Pages trigger will also need to be assigned a Custom Event trigger to ensure that the tag's conditions aren't assessed before the end user's consent choices are known.
Contrary to basic consent mode, where tags only fire when consent has been given, you may choose to load Google tags as they normally do and have them behave according to the permissions given by the end user.
So to use advanced consent mode no additional configuration is required.
Configuring the Additional Consent Settings
Open the tag you want to configured to use basic consent mode.
A tag without Additional Consent Checks configured
- Edit the tag by clicking on it.
- Expand the Consent Settings (BETA) section under the Advanced Settings section.
- Check the option labeled Require additional consent for tag to fire and select one or several of the following storage types:
- ad_storage (mapped to the Marketing category)
- analytics_storage (mapped to the Statistics category)
- functionality_storage (mapped to the Preferences category)
- personalization_storage (mapped to the Preferences category)
- security_storage (mapped to the Necessary category)
A tag with the Consent Settings expanded
Your configured tag should now look similar to this:
A tag configured with Additional Consent Checks
Configuring Additional Consent for multiple tags at once
If you have multiple tags that need Additional Consent Checks, configuring them one by one can seem like an insurmountable task.
Fortunately, you can configure multiple tags at once.
To do this, go to the Consent Overview by clicking on the shield icon to the top right.
The tags overview
On the consent overview, select the tags that you wan to configure consent for by checking their corresponding boxes.
With the tags selected, click the shield icon in the top right corner to open a new dialog.
The Consent Overview
Select Require additional consent for tag to fire and select the appropriate storage type(s).
The Consent Settings dialog
Save the configuration settings using the Save button.
Trigger configuration
If a tag has a Page View trigger assigned to it, tags will likely not fire on the page where consent is submitted.
The reason for this is that when the Page View event occurs, the banner is likely still being up and the end user has hans't yet submitted their consent choices. So the tag's conditions won't be met, and as a result won't be fired.
Submitting consent will not cause tags to be reevaluated, so the tag won't fire until a new page is visited or the page reloads.
To prevent this from happening, you need to replace the All Pages trigger with the cookie_consent_update custom event trigger.
'All pages' trigger replaced by the 'cookie_consent_update' custom event trigger
Why you should replace "All Pages" with "cookie_consent_update"
If you use an "All Pages" trigger for a tag that requires consent before it's fired, the tag won't fire when a visitor lands on your website without having previously submitted consent.
This means you will not be able to capture any data on this first page, which arguably provides the most insights.
To understand why this is the case, it's useful to understand what's actually going on when a visitor comes to your website and interacts with the banner:
- Your visitor lands on the website and Google Tag Manager (GTM) loads.
- GTM starts evaluating whether tags using the "All Pages" event are allowed to load.
Tags that require consent will not be allowed to load at this point. - The visitor submits their consent using the Cookiebot banner.
The Cookiebot script sends consent data to GTM, followed by the "cookie_consent_update" event to signal that consent data is available. - Tags that trigger on the "cookie_consent_update" custom event will be evaluated and fire if the appropriate consent is given.
Tags that were evaluated previously (like the "All Pages" trigger) are not reevaluated, and won't be fired until the pages reloads or a new page is visited. - On the new page load, consent will be available by the time tags that fire on "All Pages" are evaluated and the "cookie_consent_update" will even precede the "All Pages" event, since (if you've correctly configured it) the Cookiebot script will already have loaded, have sent consent data, and sent the "cookie_consent_update" to GTM to signal that tags that require consent can now be fired.
Triggers other than "page load" events don't need to be replaced.
You can safely assume that events such as clicks, form submissions, etc. won't occur until after the visitor has made their consent preferences known.
You therefore don't have to replace triggers that are unlikely to occur before a first consent submission, regardless of whether a tag in configured to use Advanced Mode (relies on built-in consent settigns) or Basic Consent Mode (relies on additional consent settings).
Assigning multiple triggers at once
If you have multiple tags that need to be assigned a new trigger you don't have to do this one by one.
On the Tags overview, select the tags you want to assign new a new trigger to by checking the corresponding boxes.
Click the Edit Triggers (the two overlapping circles) icon to open the triggers dialog.
The tags overview
Uncheck the trigger that needs to be replaced and click the + icon to call up a triggers overview.
Select the cookie_consent_update custom event trigger (or create it if you haven't already).
The triggers dialog
Save the trigger settings using the Save button.
Comments
1 comment
Thank you for the clear explanation on configuring tags for basic consent mode! It really helped me understand the process better.
Please sign in to leave a comment.