Consent Mode in GTM
Steps to configure the "Consent Mode" in Google Tag Manager.
Summarizing all recommended steps:
- 2.Select your "Web" type container.
- 4.Configure the related tag and its trigger.
- 5.Configure your third-party vendor tags.
- 6.Test and deploy your container.
Following the above steps, adding our template "Commanders Act | OnSite CMP API" from the Google "Community Template Gallery", you're presented with the following "Tag Configuration" which is the core area where you can manage your consent needs with GTM:
The "Commanders Act | OnSite CMP API" configuration in GTM.
First, you need to input your TrustCommander category identifiers for the following 5 categories: "Ad Storage", "Analytics Storage", "Functionality Storage", "Personalization Storage", and "Security Storage". You can find these ids by logging in to our platform and follow the section:
(2)"Categories and Tags" from the navigation sidebar.
Find your category ids.
Your ids are shown between round parentheses (see highlighted in green below):
The "Categories and Tags" section in TrustCommander.
If TrustCommander loads asynchronously in your implementation, it might not always run before your GTM container. That’s why you have the option to set a "Wait for update" value in milliseconds to control how long to wait before data is sent. This field is optional and its default value is 0. In case you need to set it, we recommend starting from the base value of 500 milliseconds.
You also need to set the default status, for each of the 5 categories, before users interact with your TrustCommander privacy banner and taking into account region-specific behavior. This is done by clicking the "Add Row" button and selecting either "Denied" or "Granted" to match with your input regions and/or sub-regions.
Select your default status for each category and by region and sub-region.
To make sure that the consent is correctly managed by GTM with third-party vendor tags, we strongly recommend to enable reactive events. Turn on the
(4)"Activate Reactive Events" and
(5)"Activate [Storage-Name] Reactive Event" for each [Storage Name] you're using. Finally, enter their
(6)"Event Name". These events will be used in the next section when configuring your third-party vendor tags.
Reactive events activation under "Advanced Features".
You also have the option to directly inject your Trust CMP script by turning on the
(8)"Inject CMP Script" and input your
Inject your Trust script directly using this template.
Disabling the default consent may come handy when you don't want to use the Consent Mode. This is done by turning on the
(10)"Advanced Features" and
(11)"Disable Default Consent".
Disable the "Default Consent".
As the last step, you need to select the "Consent Initialization - All Pages" trigger in the "Triggering" lower area:
Select "Consent Initialization - All Pages" as trigger.
While Google native product tags, such as "Google Analytics" or "Google Ads" ones, work out of the box, third-party vendor tags require additional settings to properly operate with the user consent. First, open your tag configuration and check under the
(12)"Advanced Settings" and
(13)"Consent Settings" if a consent type (E.g. "ad_storage") is already preconfigured, if not you need to add it by selecting the option
(14)"Require additional consent for tag to fire" and
(15)input the consent type(s) you want to include.
Tag specific "Consent Settings" in GTM.
Then, you need to configure its triggers and this is where we're going to use our reactive events we prepared in the previous section. Locate the "Triggering" area in your tag configuration and add a "Trigger Group".
Part 1: configure a "Trigger Group".
In the trigger group add
(16)any preexisting triggers and
(17)a trigger named as your configured reactive event.
Part 2: configure a "Trigger Group".
The latter has to be configured as a
(18)"Custom Event" with the same
(19)"Event Name" you used in the previous section and it has to fire on
(20)"All Custom Events".
Part 3: configure a "Trigger Group".