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:
Select your "Web" type container.
Add our template from the "Community Template Gallery".
Configure your tag and trigger.
Test and deploy your container.
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:
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.
Your ids are shown between round parentheses (see highlighted in green below):
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":
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".