Google Tag Manager (GTM) - Consent Mode
Steps to implement Commanders Act Consent Module with Google Tag Manager.
Last updated
Steps to implement Commanders Act Consent Module with Google Tag Manager.
Last updated
Commanders Act provides a tag template to manage the "Consent Mode" in Google Tag Manager. This seamless integration takes advantage of our Commanders Act OnSite API.
Please note: Google only requires a validated consent signal only for EEA countries and UK.
Implementing Google Consent Mode in regions beyond may negatively impact campaign performance and is not recommended.
Summarizing all recommended steps:
Access GTM.
Select your "Web" type container.
Add our tag template from the "Community Template Gallery".
Configure the related tag and its trigger.
Configure your third-party vendor tags.
Test and deploy your container.
Following the above steps, adding our template "Commanders Act CMP" 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:
First, you need to input your consent category identifiers for the following 7 categories: Ad Storage
, Analytics Storage
, Functionality Storage
, Personalization Storage
, Security Storage
, Ad User Data
and Ad Personalization
. You can define/find these identifiers by logging in to our platform and follow the section:
(A)
"Data Governance" → (1)
"Consent Management" → (2)
"Categories".
Your identifiers are shown between round parentheses (see highlighted in green below):
If you have sub-categories with the same scope of the five defined by Google, you need to use their ids instead of the main category ones. You can also rename your categories or change their ids by checking the subsection "Managing categories".
If your CMP loads asynchronously, 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 7 categories, before users interact with your 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.
Ensure that your default command accounts for regional variations in your consent strategy. For more information on customizing the default command, you can see Google’s documentation here.
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 (3)
"Advanced Features", (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.
You also have the option to directly inject your CMP script by turning on the (7)
"Advanced Features", (8)
"Inject CMP Script" and input your (9)
"URL".
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".
As the last step, you need to select the "Consent Initialization - All Pages" trigger in the "Triggering" lower area:
If your banner is hosted on your servers (on premise) or if you use our CDN 1st party feature, then you need to update the Permissions of the template.
Simply add your host URL in the tab "Injects scripts" (see block "allowed patterns").
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.
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".
In the trigger group add (16)
any preexisting triggers and (17)
a trigger named as your configured reactive event.
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".
This completes your configuration. You can now start the testing phase, leading to the final deployment in production. Learn more on how you can configure and run tests with your tags in GTM by checking the section "Consent configuration" in the "Help Center". You can also read the page Consent Mode setup provided by Google for Developers
Look our "Test your configuration" page for debbuging hints!