Please note
Google's native tags, such as Google Ads, Google Analytics, and Floodlight have built-in consent checks and will automatically adjust their behavior based on your visitor's consent choices.
This guide is intended for tags that should only load when consent is given.
To ensure data processing services only load when your visitors have consented to their use you will need to configure them to wait until the visitor has made their preferences known and act accordingly.
Tags that are "consent aware" will only fire at the moment Usercentrics CMP determines that the visitor consents to their use. This will either be at the moment of consent submission on a first visit, or immediately as the page loads for a returning visitor who submitted consent during their previous visit.
Configuring tags to require consent
Configuring a tag to be consent aware requires two components; A trigger that signals to GTM that it's time to assess whether the tag should load, and conditions that will be used for this assessment.
There are essentially two ways to configure a tag to be consent aware.
In either configuration you will need to replace the All Pages trigger with a Custom Event trigger to ensure that a tag loads immediately after permission is granted.
Creating this custom consent event is described below and the configuration specific instructions for the approaches above will be described further below the trigger creation.
Creating a custom consent event trigger
As mentioned above, this trigger will signal to GTM that it's time to assess whether the tag should load.
This trigger will replace the All Pages trigger. If you use a different trigger that is based on an interaction, such as clicks or following link will not need to be replaced.
Here are the steps to create the "Now-we-know-what-the-visitor-consented-to" trigger:
- Select Triggers in the main menu.
- Press the New button.
- Name the tag, for example "Consent Status".
- Click on the box labeled Trigger Configuration and select the Custom Event trigger type.
- Enter "consent_status" in the Event name text field.
- Press the Save button to finalize the trigger.
Category based configuration
To configure the tag to be consent aware:
- Select the tag you want to configure from the Tags section and click on it to begin editing.
- Expand the Advanced Settings section.
- Expand the Consent Settings (BETA) section.
- Select Require additional consent for tag to fire and select the appropriate storage category.
- Replace the All Pages trigger with the Consent Status custom event trigger.
- Press the Save button to save the tag.
The storage types are mapped to DPS categories as follows:
Storage type | Consent category |
---|---|
ad_storage |
Marketing |
analytics_storage |
Functional |
functionality_storage |
Functional |
personalization_storage |
Functional |
security_storage |
Essential |
Individual configuration
For this configuration you will need to use a unique trigger for each tag. Each trigger will be assigned a condition which will determine whether the tag should be fired.
We'll start by creating a new variable, which will serve as a condition for the trigger to fire.
- Select Variables from the main menu.
- Under the User-Defined Variables click the New button.
- Name the tag.
In this example I've chosen to call the variable "DPS" (data processing service) followed by the name of the service. - Click on the Variable Configuration section, and select DataLayer Variable under the Page Variables section.
- Enter the name of the service. This must be an exact match to the name listed in your configuration in the Usercentrics Admin.
- Check the box labeled Set Default Value and enter "false" in the Default Value field.
- Press the Save button to finalize the variable.
With the variable we can configure a trigger to use it as a condition.
- Select the tag you want to make consent aware from the Tags menu and click on the existing trigger to start editing it.
- Ensure that Some Custom Events is selected under This trigger fires on.
- Select the consent variable you created earlier in the first field, "contains" in the second field and enter "true" in the last field.
- Click the Save button to finalize the trigger.
Remember to publish your changes!
Comments
7 comments
I dont think this guide is complete. The setup given above for "custom consent event trigger" will fire regardless of consent is given…
Alternatively you can add the following listener for consent with i.e. GA4:
Data Layer Variable (dlv - Usercentrics) name: Google Analytics 4
Version 2
Set Default Value: false
Reference variable above in trigger with following…
Custom Event - variable with event name: (consent_status.*)
Check the box for “Use regex matching”
Trigger fires on Some Custom Events:
dlv - Usercentrics | contains | true
I hope some people find this usefull.
There is also a guide at this link that seems to fit:
https://termageddon.freshdesk.com/support/solutions/articles/66000522404-google-s-basic-consent-mode-version-2-v2-instructions
Hi Mads,
Since we rely on consent mode we don't need anything other than the consent event.
Essentially we're just waiting for Usercentrics CMP to announce that we know what a visitor has consented too and then allow the tag to assess whether it has permission to load using the additional consent settings on the tag.
Hi Richard.
Thanks for clarifying. I find your articles very useful! =)
Hi,
In the “Category based configuration” :
how to map the category “Marketing” with the “Select Require additional consent for tag to fire and select the appropriate storage category.” because Marketing is not allowed (as-storage, analytics_storage…).
Thanks.
Hi Ricou,
Marketing is mapped to ad_storage.
It just occurred to me that it might not be immediately obvious how the categories are mapped to the storage types.
I'll add a little table to the article to show how categories are mapped to storage types.
thanks a lot !
I'm looking at the recent updates including mapping categories to googles consent modes but I don't see functionality_storage or personalization_storage being updated e.g.
For the consent_status update I see:
```
dataLayer.push({
action: "onAcceptAllServices",
event: "consent_status",
type: "EXPLICIT",
ucCategory: {marketing: true, functional: true, essential: true},
…
gtm.uniqueEventId: 2595
})
```
So for above I clicked Allow All from the banner
But within the tag manager debug I see everything has been granted except functionality_storage and personalization_storage is denied.
Please sign in to leave a comment.