# How to Set Up Google Tag Manager

For a custom site managed in the Consent Pro Web App, configure Google Tag Manager with the Consent Pro template, consent defaults, and the tag triggers and checks below. Install Consent Pro on the website using the [custom-site installation guide](/web-app/install); the GTM consent configuration is a separate step.

Choose Basic or Advanced Google Consent Mode, review the actual purposes of your tags, and preserve purchase and lead triggers. After reviewing the changes, publish the GTM container and verify its behavior on the published website. This guide covers custom sites; use the [Webflow GTM guide](/webflow/google-tag-manager) for a Webflow site.

## Choose triggers and consent checks first

Choose Basic or Advanced for Google measurement before changing Google tags. If you have not decided yet, review both options first.

| Tag purpose                                      | Recommended trigger                      | Consent checks                                                                  |
| ------------------------------------------------ | ---------------------------------------- | ------------------------------------------------------------------------------- |
| Consent Pro defaults                             | Consent Initialization — All Pages       | Establish approved defaults before measurement                                  |
| GA4 initialization — Basic                       | `analytics-activated`                    | Require `analytics_storage`                                                     |
| Google initialization — Advanced                 | Initialization — All Pages               | Built-in consent behavior; no additional `analytics_storage` firing restriction |
| Consent-dependent analytics initialization       | `analytics-activated`                    | Matching analytics consent checks                                               |
| Consent-dependent marketing initialization       | `marketing-activated`                    | Matching marketing consent checks                                               |
| Consent-dependent personalization initialization | `personalization-activated`              | Matching personalization consent checks                                         |
| Purchase, lead, click or SPA navigation          | Keep the original business-event trigger | Appropriate checks for the selected mode and actual purpose                     |

Category activation events fire once per page when the category becomes active, including remembered consent on returning visits. Choose the category from the tag's actual purpose. Reserve `consent-updated` for deliberately configured update handling: it also follows rejection and can occur repeatedly. Review an existing valid setup before replacing its triggers.

Activation does not stop already-loaded code after withdrawal. Test subsequent requests, consent persistence and any vendor shutdown behavior separately. See [Consent-aware GTM troubleshooting](/knowledge/gtm-troubleshooting).

## 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>`.

With scripting enabled, normal HTML `<noscript>` content is inactive. A tracking fallback can run when JavaScript and the CMP are disabled; remove tracking fallbacks while preserving harmless no-script content.

## 2. Import the Consent Pro Template to Google Tag Manager

1. Download the Consent Pro GTM template:

<a class="download-template" href="/gtm/templates/Consent%20Pro%20-%20GTM%20Template.tpl" download>
  <span class="download-template-icon"></span>
  <span class="download-template-info">
    <strong>Consent Pro — GTM Template</strong>
    <small>.tpl &nbsp;·&nbsp; GTM Custom Template</small>
  </span>
  <span class="download-template-cta">Download</span>
</a>

2. Open your **Google Tag Manager** container.
3. Navigate to ’**Templates’** in the left sidebar.
4. In the ’**Templates’ tab**, click **’New’**.

![New template button in Google Tag Manager](</gtm/images/docs_(25).png>)

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

![Import option in the Google Tag Manager template menu](</gtm/images/docs_(26).png>)

6. 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](</gtm/images/docs_(10)_(2).png>)

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

![Community Template Gallery terms dialog](</gtm/images/docs_(28).png>)

8. Close the Template Editor.

![Consent Pro listed under custom tag templates](</gtm/images/docs_(9)_(2).png>)

Done ✅

## 3. Create the Consent Initialization Tag

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

![New tag button in Google Tag Manager](</gtm/images/docs_(29).png>)

2. Click on ’**Tag Configuration’**

![Tag Configuration panel in Google Tag Manager](</gtm/images/docs_(30).png>)

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

![Consent Pro template selected as the tag type](</gtm/images/docs_(10)_(3).png>)

4. Click on “**Triggering**”.

![Triggering section of the Consent Pro tag](</gtm/images/docs_(31).png>)

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

![Consent Initialization All Pages trigger selected](</gtm/images/docs_(11)_(1).png>)

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

![Consent Pro Init tag ready to save](</gtm/images/docs_(12)_(1).png>)

You have successfully added the Consent Init tag ✅

## 4. Configure Region-Specific Consent Settings

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](</gtm/images/docs_(13)_(1).png>)

2. Click on ‘**Tag Configuration’**.

![Consent Pro Init tag configuration](</gtm/images/docs_(14)_(1).png>)

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

![Region-Specific Consent Settings section](</gtm/images/docs_(32).png>)

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

![Add Region Setting button](</gtm/images/docs_(33).png>)

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

|                             | **Opt In** | **Opt Out** | **Don't Sell** | **Informational** |
| --------------------------- | ---------- | ----------- | -------------- | ----------------- |
| **Analytics Storage**       | Denied     | Granted     | Granted        | Granted           |
| **Ad Storage**              | Denied     | Granted     | Granted        | Granted           |
| **Functionality Storage**   | Denied     | Granted     | Granted        | Granted           |
| **Personalization Storage** | Denied     | Granted     | Granted        | Granted           |
| **Ad User Data**            | Denied     | Granted     | Granted        | Granted           |
| **Ad Personalization**      | Denied     | Granted     | Granted        | Granted           |

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](/web-app/Opt-in%20Default%20Consent.png)

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](/web-app/Opt-out%20Default%20Consent.png)

**Why this matters**

- **Opt In** (e.g., GDPR): Users must explicitly consent before any tracking. GTM defaults use `Denied` for storage and relevant signals. A chosen Basic approach also needs firing gates; Advanced may send cookieless pings while denied.
- **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.

6. 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](/web-app/banners-regions.png)

7. Click **‘Add’** to finish the region settings.

![Add button for a completed region setting](</gtm/images/docs_(6)_(1).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.

![Multiple region settings configured in the Consent Pro tag](</gtm/images/docs_(35).png>)

8. **Optional:** review whether you need advanced settings.

![Advanced consent options in the Consent Pro tag](</gtm/images/docs_(7)_(1).png>)

- **Wait for consent update**: Default is `1000`ms. This briefly delays Google consent processing while an update is expected. It does not wait indefinitely for a visitor, and does not block third-party tags or replace additional consent checks.
- **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.

9. Click **'Save'** to finish the Regions setup.

![Save button for the completed region configuration](</gtm/images/docs_(36).png>)

## Basic vs Advanced Consent Mode

Consent Pro supports both [Basic and Advanced Google Consent Mode](/web-app/google-consent-mode). Select the intended approach before changing Google tags. Steps 5–7 below describe consent-dependent initialization and additional checks for a chosen Basic approach. Advanced allows supported Google tags to send cookieless pings while storage is denied; use the [dedicated guide](/web-app/google-consent-mode) for its separate Google-tag configuration. Preserve business-event triggers in either approach.

<a id="_5-create-consent-update-trigger"></a>

## 5. Create category activation triggers

Create only the category triggers needed by the approved tags:

1. In **Triggers**, choose **New**.
2. Name the trigger **Analytics Activated**, **Marketing Activated** or **Personalization Activated**.
3. Choose **Custom Event**.
4. Set the exact **Event name** to `analytics-activated`, `marketing-activated` or `personalization-activated`, respectively. Select **All Custom Events** for that exact name; leave regex matching off.
5. Save the trigger.

For GA4 initialization in **Basic** mode, use **Analytics Activated** and require `analytics_storage`. For the ordinary Google tag in **Advanced** mode, use **Initialization — All Pages** with built-in consent behavior instead. The Consent Pro defaults tag stays on **Consent Initialization — All Pages** in both modes.

## 6. Configure consent-aware initialization triggers

Use the matching category trigger for consent-dependent initialization only. For example, a marketing pixel's initialization uses **Marketing Activated** (`marketing-activated`) plus the marketing checks appropriate to its actual purpose.

1. Open the initialization tag under **Tags**.
2. Review its existing triggers, consent settings and firing frequency. An existing valid integration does not need automatic replacement.
3. For an approved change, replace its page-load trigger with the matching category activation trigger. Leaving an ungated page-load trigger attached would still let the tag fire early.
4. Add the matching consent checks in Step 7.
5. Repeat only for approved initialization tags, then verify their behavior in Tag Assistant and the browser.

Keep purchase, lead, form-submit, click and SPA navigation triggers intact. They describe business events, not consent changes. Add appropriate checks for the selected mode and purpose. A blocked business event is not automatically replayed when the visitor later accepts.

`consent-updated` remains available for deliberately configured update handling with appropriate checks and firing frequency. It also follows rejection; do not use it as proof that a category was accepted. Category activation does not stop already-loaded code after withdrawal. See [Consent-aware GTM troubleshooting](/knowledge/gtm-troubleshooting).

## 7. Add the respective additional consent checks for your tags.

Require the consent types that match each blocked tag’s purpose. Native Google tags in Advanced mode use their built-in checks instead; adding additional checks changes that behavior.

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](/web-app/trackers-from-gtm.png)

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

![Tracker details shown in the Consent Pro preferences panel](/gtm/images/image.png)

**Note:** Category activation events are the recommended starting point for consent-dependent initialization. Preserve business-event triggers. A scan cannot prove enforcement for arbitrary GTM tags; verify the published container in Tag Assistant.

⚠️ 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](</gtm/images/docs_(46).png>)

2. Click on **‘Tag Configuration’.**

![Tag Configuration section of the Facebook Pixel tag](/gtm/images/docs%201.png)

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

![Require additional consent for tag to fire option](</gtm/images/docs_(55).png>)

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

![Marketing consent selected as an additional consent check](/web-app/Marketing%20Example.png)

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

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

![Mapping between Consent Pro categories and Google Tag Manager consent checks](/web-app/Categories.png)

| Consent Pro category | Google consent signals                             |
| -------------------- | -------------------------------------------------- |
| Analytics            | `analytics_storage`                                |
| Marketing            | `ad_storage`, `ad_user_data`, `ad_personalization` |
| Personalization      | `functionality_storage`, `personalization_storage` |
| Essential            | `security_storage`                                 |

6. Add applicable checks to consent-dependent tags, including conversion tags with their existing business-event triggers. GTM requires all selected checks to be granted. For supported Google tags in advanced mode, distinguish built-in behavior from additional firing restrictions.

**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](</gtm/images/docs_(47).png>)

2. and **'Publish'.**

![Publish button for the Google Tag Manager container](</gtm/images/docs_(48).png>)

## 9. Confirm that the Google Tag Manager setup is completed in the Consent Pro app

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](/web-app/data-privacy-check.png)

## Verify before completing setup

Test fresh rejection, analytics-only acceptance, marketing acceptance, returning visitors, purchase events, repeated updates, and withdrawal. Confirm consent defaults precede ordinary tags and inspect actual requests and cookies. See [the detailed verification checklist](/knowledge/gtm-troubleshooting#verification-checklist).
