Skip to content

How to Set Up Google Tag Manager

Follow this step-by-step guide to set up Google Tag Manager with Consent Pro.

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

Remove the Google Tag Manager <noscript> tag from wherever Google Tag Manager is installed on your site — usually the shared page template or layout that renders <head> and <body>.

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

New template button in Google Tag Manager

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

Import option in the Google Tag Manager template menu

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

Consent Pro template loaded in the Google Tag Manager template editor

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

Community Template Gallery terms dialog

  1. Close the Template Editor.

Consent Pro listed under custom tag templates

Done ✅

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

New tag button in Google Tag Manager

  1. Click on ’Tag Configuration’

Tag Configuration panel in Google Tag Manager

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

Consent Pro template selected as the tag type

  1. Click on “Triggering”.

Triggering section of the Consent Pro tag

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

Consent Initialization All Pages trigger selected

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

Consent Pro Init tag ready to save

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.

Consent Pro Init tag in the Google Tag Manager tags list

  1. Click on ‘Tag Configuration’.

Consent Pro Init tag configuration

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

Region-Specific Consent Settings section

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

Add Region Setting button

  1. Select the storage fields based on the examples below.
Opt InOpt OutDon't SellInformational
Analytics StorageDeniedGrantedGrantedGranted
Ad StorageDeniedGrantedGrantedGranted
Functionality StorageDeniedGrantedGrantedGranted
Personalization StorageDeniedGrantedGrantedGranted
Ad User DataDeniedGrantedGrantedGranted
Ad PersonalizationDeniedGrantedGrantedGranted

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

Select ’Denied’ in all fields.

Opt-in region setting with all consent states denied

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

Select ’Granted’ in all fields.

Opt-out region setting with all consent states granted

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 codes assigned to the banner in Consent Pro.

Open Consent banner > Banners, then open the banner's Geotarget control to review its regions. Enter the corresponding codes in Google Tag Manager as a comma-separated list, such as US-CA,GB,FR.

  • For the default banner, enter exactly Global — do not enter the UI label Global (default).
  • Use two-letter country codes such as GB or FR, and ISO 3166-2 subdivision codes such as US-CA for US states.
  • The app's EU option is a grouping shortcut. In Google Tag Manager, list the EU country codes and GB individually rather than entering EU.

Consent banner Banners tab showing each banner's Geotarget

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

Add button for a completed region setting

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.

Multiple region settings configured in the Consent Pro tag

  1. Optional: review whether you need advanced settings.

Advanced consent options in the Consent Pro tag

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

Save button for the completed region configuration

Consent Pro supports both Basic and Advanced Google Consent Mode. Steps 5–7 below implement Basic mode (the recommended default). Use Advanced mode only if you need GA4 cookieless pings for behavioral modeling — see the dedicated guide for GA4 tag configuration, verification, and troubleshooting.

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.

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

New trigger button in Google Tag Manager

  1. Name it 'Consent Updated' and click on 'Trigger Configuration'.

Consent Updated trigger name field

  1. Choose 'Custom Event'.

Custom Event selected as the trigger type

  1. Fill 'Event Name' with 'consent-updated', and select 'All Custom Events’.

consent-updated entered as the custom event name

  1. and 'Save'.

Save button for the Consent Updated trigger

Apply this step to marketing and non-Google tags. If you use Advanced Consent Mode, configure GA4 separately on Consent Initialization instead.

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

Facebook Pixel tag selected in Google Tag Manager

  1. Click on 'Edit icon'.

Edit button on the Facebook Pixel tag

  1. Remove the current trigger.

Existing trigger selected for removal

  1. Click on 'Triggering'.

Triggering panel for the Facebook Pixel tag

  1. Select the trigger 'Consent Updated'.

Consent Updated selected as the replacement trigger

  1. Do the same for all marketing and non-Google tags in Google Tag Manager. Skip GA4 if using Advanced Consent Mode.

This is also required to comply with Google Consent Mode v2.

  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.

Trackers detected from Google Tag Manager in the Analytics category

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

Tracker details shown in the Consent Pro preferences panel

Note: Our solution only detects scripts from Google Tag Manager that are triggered on 'All Pages' or by Consent Pro custom events such as 'consent-updated' or, in version 1, '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 you want to add the additional consent check. For this example, we are going to use the 'Facebook Pixel' tag again:

Facebook Pixel tag selected for consent configuration

  1. Click on ‘Tag Configuration’.

Tag Configuration section of the Facebook Pixel tag

  1. Go to 'Advanced Settings' > 'Consent Settings'  and select 'Require additional consent for tag to fire'.

Require additional consent for tag to fire option

  1. Choose the additional consents based on the category in the app. (check the visual reference below):

Marketing consent selected as an additional consent check

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

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

Mapping between Consent Pro categories and Google Tag Manager consent checks

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

Note: Some scripts or tags may set trackers with different categories, such as Gtag. In these cases, add multiple consent checks based on the categories in the app.

8. Submit and publish the changes in Google Tag Manager

  1. Click on 'Submit'.

Submit button in Google Tag Manager

  1. and 'Publish'.

Publish button for the Google Tag Manager container

Open the project Overview. In Data Privacy Check, the Configure GTM row links to these docs and offers Mark as done — click it once the container is published.

Configure GTM row in Data Privacy Check on the project overview