Consent Enablement in GTM

Steps to configure consent in Google Tag Manager.

Commanders Act provides a template to manage consent in Google Tag Manager. This seamless integration takes advantage of TrustCommander OnSite API.


Summarizing all recommended steps:

  1. Access GTM.

  2. Select your "Web" type container.

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

  4. Configure your tag and trigger.

  5. Test and deploy your container.

Configure your tag and trigger

Following the above steps, and searching for our template "Commanders Act | OnSite CMP API", you're presented with the following "Tag Configuration" which is the core area where you can manage your consent needs with GTM:

GTM "Tag Configuration" preview.

First, you need to input your TrustCommander category identifiers (ids) 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.

Find your TrustCommander category ids by following the above sections.

Your ids are shown between round parentheses (see highlighted in green below):

The "Categories and Tags" section in TrustCommander.

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 have to set the default status, for each of the 5 categories, before users interact with your TrustCommander privacy banner. This is done by selecting either "Denied" (default value) or "Granted":

Select your default status for each category.

Lastly, you need to select the "Consent Initialization - All Pages" trigger in the "Triggering" lower area:

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