Skip to content

Google Tag Manager Setup

Follow this setup if you are using Google Tag Manager to manage your third-party scripts.

Prerequisites

Before starting this setup, ensure you have:

  • A Google Tag Manager account
  • Administrative access to your website
  • Consent Pro installed and configured on your website

1. Remove the <noscript> Tag from Google Tag Manager

Go to Site Settings > Custom Code and remove the Google Tag Manager <noscript> tag from the Footer code.

image.png

  1. Download the Consent Pro GTM template: Download GTM Template
  2. Open your Google Tag Manager container.
  3. Navigate to ’Templates’ in the left sidebar.
  4. In the ’Templates’ tab, click ’New’.

image.png

  1. Click the three dots icon (⋮) in the top-right corner and select ’Import’.

image.png

  1. Select the Consent Pro - GTM Template.tpl file you just downloaded. The Template Editor will load with the Consent Pro configuration.

Frame 48096478 (3).png

  1. Agree to the Community Template Gallery Terms of Service, then click ’Save’ to add the template to your workspace.

image.png

  1. Close the Template Editor.

image.png

Done ✅

  1. In the ’Tags’ section, click on ’New’.

image.png

  1. Click on ’Tag Configuration’

image.png

  1. Select ’Consent Pro - GTM Template’ from the list in the Custom section.

image.png

  1. Click on “Triggering”.

image.png

  1. Select ’Consent Initialization - All Pages’. This is crucial as it ensures Consent Pro loads before any collection tags.

image.png

  1. Name your tag (e.g., "Consent Pro Init") and click ’Save’.

image.png

You have successfully added the Consent Init tag ✅

Region-specific consent settings allow you to define default consent states based on the user's geographic location. This is particularly useful for complying with regional privacy regulations such as GDPR in the European Union or CCPA in California.

By configuring these settings, you can ensure that users from specific regions have their consent preferences initialized appropriately before any tags fire, providing a compliant and seamless experience across different jurisdictions.

  1. In the ‘Tags’ tab, select the ‘Consent Pro Init’ tag you just added.

docs (16).png

  1. Click on ‘Tag Configuration’.

docs (17).png

  1. Click on the ’Region-Specific Consent Settings’ accordion to expand it.

docs.png

  1. Click ‘Add Region Setting’ to create a new region configuration.

docs.png

  1. Select the storage fields based on the examples below.

If you have an ‘Opt-in banner’ added to Consent Pro,

Select ’Denied’ in all fields.

docs (4).png

If you have an ‘Opt-out’, ‘Do Not Sell’ or ‘Informational Banner’ added to Consent Pro,

Select ’Granted’ in all fields.

docs (5).png

Opt InOpt OutDon't SellInformational
Analytics StorageDeniedGrantedGrantedGranted
Ad StorageDeniedGrantedGrantedGranted
Functionality StorageDeniedGrantedGrantedGranted
Personalization StorageDeniedGrantedGrantedGranted
Ad User DataDeniedGrantedGrantedGranted
Ad PersonalizationDeniedGrantedGrantedGranted

Why this matters

  • Opt In (e.g., GDPR): Users must explicitly consent before any tracking. GTM defaults must be Denied so tags don't fire until consent is given.
  • Opt Out / Don't Sell / Informational: Tracking is allowed by default. GTM defaults should be Granted since users can opt out later if they choose.
  1. Fill in ‘Regions’ with the region you selected when you created the banner.

Go to ‘Banners’ and click the copy button to copy the regions in the ‘Regions’ column.

Paste them into the ‘Regions’ field in Google Tag Manager.

docs.png

  1. Click ‘Add’ to finish the region settings.

docs (2).png

Note: If you have more than one banner created in Consent Pro, feel free to add more region settings. Here is an example of a setup with multiple banners.

docs.png

  1. Optional: Review whether you need advanced settings.

docs.png

  • Wait for consent update: Default is 1000ms. This defines the time to wait for a consent update before firing tags. Prevents tags from firing before user consent is processed. Recommended: 500-2000ms.
  • URL passthrough: Enable if you want to pass advertising click information (gclid, dclid, etc.) through URLs while waiting for consent. Helps preserve attribution data during consent flow.
  • Ads data redaction: Enable if you want to remove advertising identifiers from requests when consent is denied. Routes traffic through cookieless domains for privacy compliance.
  1. Click 'Save' to finish the Regions setup.

docs.png

To ensure proper detection and blocking, the triggers must be changed to use custom events from our solution. This allows us to detect the scripts and block them before they load.

5.1. Create a trigger for Essential Cookies

  1. Go to 'Triggers' and click 'New'.

doc-1.png

  1. Name it 'Essential Cookies' and click on 'Trigger Configuration'.

doc-2.png

  1. Choose 'Custom Event'.

doc-3.png

  1. Fill 'Event Name' with 'essential-activated', select 'Some custom Events’, select 'Event', choose 'equals', and enter 'essential-activated'.

doc-4.png

  1. Click 'Save'.

doc-5.png

If you want more control over when to fire your tags, click on '+' button.

doc-6.png

And select the conditions you want. They can be triggered when a user accesses a specific page or when another custom event occurs:

docs.png

5.2. Create a trigger for Marketing Cookies

  1. Go to 'Triggers' and click 'New'.

doc-1.png

  1. Name it 'Marketing Cookies' and click on 'Trigger Configuration'.

Frame 48096478 (14) 1.png

  1. Choose 'Custom Event'.

doc-3.png

  1. Fill 'Event Name' with 'marketing-activated', select 'Some custom Events’, select 'Event', choose 'equals', and enter 'marketing-activated'.

docs (6).png

  1. Click 'Save'.

docs (7).png

If you want more control over when to fire your tags, click on '+' button.

docs (8).png

And select the conditions you want. They can be triggered when a user accesses a specific page or when another custom event occurs:

docs (9).png

5.3. Create a trigger for Personalization Cookies

  1. Go to 'Triggers' and click 'New'.

doc-1.png

  1. Name it 'Personalization Cookies' and click on 'Trigger Configuration'.

Frame 48096478 (22) 1.png

  1. Choose 'Custom Event'.

doc-3.png

  1. Fill 'Event Name' with 'personalization-activated', select 'Some custom Events’, select 'Event', choose 'equals', and enter 'personalization-activated'.

docs (1).png

  1. Click 'Save'.

docs (2).png

If you want more control over when to fire your tags, click on '+' button.

docs (3).png

And select the conditions you want. They can be triggered when a user accesses a specific page or when another custom event occurs:

docs (4).png

5.4. Create a trigger for Analytics Cookies

  1. Go to 'Triggers' and click 'New'.

doc-1.png

  1. Name it 'Analytics Cookies' and click on 'Trigger Configuration'.

Frame 48096478 1.png

  1. Choose 'Custom Event'.

doc-3.png

  1. Fill 'Event Name' with 'analytics-activated', select 'Some custom Events', select 'Event', choose 'equals', and enter 'analytics-activated'.

docs (10).png

  1. Click 'Save'.

docs (11).png

  1. If you want more control over when to fire your tags, click on '+' button.

docs (12).png

  1. And select the conditions you want. They can be triggered when a user accesses a specific page or when another custom event occurs:

docs (13).png

  1. Ensure the website was scanned recently, or scan the website again.

Our solution will detect the scripts added to Google Tag Manager and help you categorize them. This is an important step to make sure the categories match in the app and in Google Tag Manager.

image.png

And also to show users the tracker details in the preferences panel.

image.png

Note: Our solution only detects scripts from Google Tag Manager that are triggered on “All Pages” or with Consent Pro custom events such as “essential-activated”, “marketing-activated”, “analytics-activated”, and “personalization-activated”. If you use a different trigger or another consent tool, update the triggers to “All Pages” to continue the setup.

⚠️ If your script uses document.write, make sure to enable “Support document.write” in the tag settings. Otherwise, the script may not execute correctly and may not be detected by Consent Pro.

  1. Select the tag in the ‘Tags’ tab. For this example, we are going to use the 'Facebook Pixel' tag:

Frame 48096478 (31) 1.png

  1. Click on 'Edit icon'.

Frame 48096478 (32) 1.png

  1. Remove the current trigger.

Frame 48096478 (33) 1.png

  1. Click on 'Triggering'.
  2. Select the category based on the category labeled in the app.

docs.png

That means the Facebook Pixel script will only load when the user consents to the 'Marketing' category or clicks on 'Accept All'.

  1. Do the same for all your tags added to Google Tag Manager.
  1. Select the tag you want to add the additional consent check. For this example, we are going to use the 'Facebook Pixel' tag again:

Frame 48096478 (31) 2.png

  1. Click on ‘Tag Configuration’.
  2. Go to 'Advanced Settings' > 'Consent Settings' and select 'Require additional consent for tag to fire'.

Frame 48096478 (36) 1.png

  1. Choose the additional consents based on the previously selected trigger (check the visual reference below):

Frame 48096478 (37) 1.png

  1. Visual reference for mapping the Consent Pro categories with additional consents:

Frame 48096478 (38) 1.png

Add the additional checks to every tag inside Google Tag Manager that requires user consent.

8. Submit and publish the changes in Google Tag Manager

  1. Click on 'Submit'.

Frame 48096478 (1).png

  1. Click 'Publish'.

Frame 48096478 (2).png

In the ‘Actions’ tab, check the checkbox in the Google Tag Manager message within the Consent Pro app.

docs (3).png