Consent Mode in GTM

Steps to configure the "Consent Mode" in Google Tag Manager.

Commanders Act provides a tag template to manage the "Consent Mode" in Google Tag Manager. This seamless integration takes advantage of our TrustCommander OnSite API.

Setup

Summarizing all recommended steps:

  1. Access GTM.

  2. Select your "Web" type container.

  3. Add our tag template from the "Community Template Gallery".

  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:

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: (1)"TRUST" → (2)"Categories and Tags" from the navigation sidebar.

Your ids 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 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.

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 Trust 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:

Configure your third-party vendor tags

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".

Last updated