PubConsent
Web Standard Integration

GTM Integration (Consent Mode)

13min
google tag manager offers various functionalities that interact with each other to help you manage tag behavior in response to settings consents https //support google com/analytics/answer/9976101 this documentation is intended to provide a detailed overview of each setting in google’s consent mode, strictly following the explanations and guidelines as provided by google it does not imply that the consent mode settings are designed to satisfy or address any particular regulatory requirements the complete explanation of how google's consent mode works is available at the following link https //support google com/google ads/answer/10000067 https //support google com/google ads/answer/10000067 the following guide provides the steps to integrate and use the pubconsent template for google tag manager this template has been created to integrate pubconsent with gtm, which means that the pubconsent script still needs to be integrated into the pages this integration is valid for both cmp type we offer before following this guide, make sure that the pubconsent integration code available in the configurator is present on the page make sure you read the documentation provided by the google at the following link by checking the tag manger sections https //developers google com/tag platform/security/guides/consent?consentmode=advanced https //developers google com/tag platform/security/guides/consent?consentmode=advanced template import log in to google tag manager and open the 'workspace' tab click on 'search gallery' in the templates section of google tag manager now search for "pubtech cmp" and then click the "add to workspace" button template usage log in to google tag manager and open the 'workspace' tab create a tag by clicking the 'new' button open the tag configuration and select the pubtech cmp template imported previously here you can configure our pubtech cmp template before proceeding to configure the default values from the google tag manager integration for consents, we can configure the ads data redaction and urlpassthrough parameters by activating the option ads data redaction when ad storage is denied, ad click identifiers sent in network requests by google ads and floodlight tags will be redacted network requests will also be sent through a cookieless domain the option urlpassthrough improve the quality of ad click measurement when ad storage is denied by sending data directly in the urls by clicking on 'add row', you can specify the default parameters (detailed explanation below) here you can configure the region (leave it empty by default), the types of consent granted, and the types of consent denied these are the default configurations when gtm starts its execution on the page based on your preferences, you can write the types of consent granted or denied here is the complete list of consent types ad storage ad user data ad personalization analytics storage functionality storage personalization storage security storage add the configurations and click on the "add" button configuration used in the example region granted consent types ad storage,analytics storage,personalization storage,security storage denied consent types functionality storage if you want to specify different behaviors for different regions, you also need to add the default configuration with an empty region now you need to choose the trigger for this tag here, choose the trigger "consent initialization all pages" change the name at the top left and click the "save" button at this point, you have configured the tag correctly after completing the entire procedure, you can proceed with the normal testing using gtm preview google documentation links https //support google com/analytics/answer/9976101 https //support google com/analytics/answer/9976101?hl=it https //support google com/tagmanager/answer/10718549 https //support google com/tagmanager/answer/10718549 to get an overview of consent, we recommend enabling consent overview within tag manager within tag manager, go to "admin" > "container" > "container settings" > "enable consent overview " consents' mapping (google consent mode) to know which user choices correspond to google's consent types, here's the corresponding mapping we provide ad storage > tcf purpose 1 ad user data > tcf purpose 1 e 7 ad personalization > tcf purpose 3 e 4 analytics storage > cookie measurement functionality storage > cookie feature personalization storage > cookie user experience security storage > cookie feature the consent mapping is 1 to 1, meaning that in the consent panel you will see the types of consent from google consent mode listed without any mask consent trigger if you need a trigger that is executed when there's consent, our integration sends an event to gtm called pubtech queue on consent thanks to this event, it's possible to create a trigger in gtm to be used according to the execution needs of your gtm tags the event we show below is triggered upon the user's consent release upon the user's consent change at the beginning of the page if consent has already been previously given the management or removal of any triggered tags throughout the page is the responsibility of those who implement the tags the trigger to create in the trigger section of gtm is a custom event , adding the event name pubtech queue on consent once the trigger is saved, you can use it as a trigger for your tags now you can use this trigger directly or in combination with other triggers according to your needs we want to inform you that this custom event has been added because through google tag manager triggers we noticed that it's not possible to execute tags when the user clicks to give consent (whether it's a refusal or an accept all) because it can happen at an unknown time however, once consent is obtained, the cmp will update the consent status in gtm as quickly as possible here is the link to the google documentation for implementations and configurations https //support google com/analytics/answer/9976101 https //support google com/analytics/answer/9976101