How to block tags using Google Tag Manager until reader consent is granted (consent mode tag blocking)

Privacy regulations (like GDPR) require certain tracking tags to load only after a site visitor gives consent.

If you use Google Tag Manager (GTM) to load tracking scripts (like Google Analytics, Meta Pixel, affiliate tracking, or other marketing tools), those tags may fire immediately when someone visits your site.

In some regions (like the EU), privacy laws require certain tracking technologies to load only after a visitor gives consent.

If your GTM tags fire before consent:

  • You may unintentionally violate privacy regulations (GDPR, etc.)
  • You may conflict with Raptive’s consent framework
  • You may create compliance risks for your site

This guide shows you how to prevent that.

What this guide does

This setup ensures that:

  • GTM tags fire after reader consent is granted
  • Your tags align with Raptive's CMP (Consent Management Platform)
  • You reduce compliance risk while maintaining control over your tracking tools

What is "consent mode"?

Consent Mode is a Google tool that allows your site to communicate a visitor’s consent choices to Google services (like Google Analytics and Google Ads).

However:

  • Consent Mode only controls Google tags
  • It does not automatically block non-Google tags in GTM
  • Additional configuration is required to ensure all vendors respect consent

That additional configuration is what this guide walks you through.

Do I need this setup?

You likely need this guide if you:

  • Use Google Tag Manager (GTM)
  • Load any tracking scripts through GTM (analytics, pixels, affiliate scripts, third-party tracking, etc.)
  • You want those tags to fire only after user consent

How it works (in plain English)

  1. Raptive collects user consent via the CMP.
  2. A consent signal is pushed to the data layer.
  3. GTM reads that signal.
  4. Tags fire only if consent exists for the associated vendor.

Without this setup, many third-party tags in GTM will fire as soon as the page loads, even if consent hasn’t been granted.

Guide steps overview

Step 1: Install the ConsentManager template

Step 2: Add Vendor IDs associated with your tags

Step 3: Connect triggers to tags

Step 4: Testing your Consent Mode configuration

Which steps apply to my setup?

Not every creator needs every step.

If you ONLY use GTM for Google products (like Google Analytics) If you use GTM for third-party products (including Google products or not)

Follow Step 1 only

Google consent mode will control Google tags

you do not need to create vendor-specific triggers unless you want to block non-Google tags

Follow Steps 1-4

Consent mode alone does not block non-Google tags

You must create vendor-specific triggers to prevent them from fireing before consent

Regional Note: Raptive’s current consent integration applies globally and cannot be configured differently by region.

Important Legal Disclaimer: Raptive does not provide legal advice. Raptive can provide support on the implementation of industry standards and partner technical requirements only, and is not responsible for your legal compliance. If you have concerns regarding legal or regulatory issues, you should consult with your own lawyer.

By the end of this setup, your GTM tags will only fire after user consent is granted, preventing unauthorized tag loading.

Before You Begin

Please review this checklist before starting. Most setup issues happen when one of these items is missing.

You must have

  • Access to your Google Tag Manager
  • A list of vendors that load via GTM
  • The vendor IDs for those vendors from Raptive’s vendor list

Contact Raptive support before starting

Open a support ticket and tell us

  • Tell us you plan to set up Consent Mode tag blocking within your GTM
  • Tell us what Vendors you plan to include

We will confirm everything is configured correctly on our end and provide:

  • Consentmanager.net ID
  • Consentmanager.net host
  • Consentmanager.net CDN

You will need this information during Step 1.

What Success Looks Like

By the end of this setup:

  • GTM tags will not fire before consent
  • Vendor-specific tags will fire only when consent exists
  • Testing in EU opt-out mode will show no unauthorized tag firing

How to block GTM tags based on user consent

Step 1: Install the ConsentManager template

Install the template

  • From your GTM account, go to Tags and click New
  • Give your tag a name (e.g., Raptive Consent Tag Manager) and click the Tag Configuration section.
  • Click the Community Template Gallery option
  • Click the Search icon and search for "Consentmanager"
  • Click Add to workspace to add the template to your GTM account
  • If this message appears, click Add. Raptive partners with ConsentManager for the consent mode feature; they are an authorized partner

Configure the template

Input the following under Tag Configuration:

  • Consentmanager ID, Host, and CDN: This information is provided by Raptive. If you do not have this info, please content the Raptive support team
  • Enable Google consent mode: Ensure this box is checked in the template configuration.
  • Consent mode defaults: Ensure all checkboxes under "Consent mode defaults" are unchecked. This indicates that no consent is assumed.
  • Timeout: Set the timeout to 1500.
  • Disable CMP: Check the box to disable the CMP pop-up. Raptive's ad code will load the CMP separately from GTM. We are only using this template for consent mode features.

Input the following under Triggering

  • Firing Triggers: Set the trigger to Consent Initialization - All Pages

Save and Review

Once saved, all settings for this Tag should appear as follows:

If you ONLY use GTM for Google products (like Google Analytics), you are done. Be sure to Submit and Publish your changes. You will know all changes have been published once the Workspace Changes reads 0

If you use GTM for Google and Non-Google products, proceed to the next steps below.

Step 2: Add Vendor IDs associated with your tags

In the following steps, you will create a variable to save the list of vendor IDs that the user must consent to for the tag to load on your pages.

Create triggers for vendor consent

You will create a reusable trigger that fires only when consent has been given for a specific vendor or a list of vendors.

Important: Only use one vendor per trigger. If you have more than one vendor, you will create multiple triggers, with each trigger containing one vendor. 

  • Go to Triggers and click New 
  • Name the trigger after the vendor (e.g., Pinterest cmpTrigger) and click Trigger Configuration then Custom Event

Set the following configuration:

  • Event Name: cmpEvent
    • The event name is critical for this configuration to operate properly. If an incorrect name is entered, the vendor ID data will not be read, and the tag will not fire.
  • This trigger fires on: Some Custom Events
  • Add a Condition:
    • Variable: cmpConsentVendors
    • Operator: contains
    • Value: Include your partner’s vendor ID with leading/trailing commas, e.g., ,s49,
      • Note: The leading and trailing commas are required

Click Save. Repeat this step for each vendor you want to control tags for. 

Create the cmpConsentVendors variable

  • Go to Variables and under User-Defined Variables, click New
  • Give the variable a Name (e.g., cmpConsentVendors), and click Variable Configuration
  • Select Data Layer Variable

Set the following configuration:

  • Data Layer Variable Name: cmpConsentVendors
    • This variable contains the list of vendors you want to check for consent on your tags. This name should match the Trigger Configuration variable that was created in the previous steps

Step 3: Connect triggers to tags

With the variable and trigger created, you can now enforce consent on your existing non-Google product tags. Your tags will fall into one of two categories:

Tags without existing triggers

  • Edit the Tag
  • Add the vendor-specific trigger you created in Step 2
  • Save

Tags with existing triggers

  • Go to Triggers > New
  • Give the trigger a name (e.g., Pinterest TriggerGroup) and select the Trigger Confirmation > Trigger Group
  • Add:
    • The existing trigger you have for your tag
    • The vendor-specific consent trigger (e.g., Pinterest cmpTrigger with ,s49,)
  • Save the Trigger Group
  • Update the corresponding tag to use this Trigger Group instead of a single trigger
  • Confirm the two triggers use “AND” to both be true to fire
  • Save

This ensures the tag only fires if both the original condition and user consent are met.

Step 4: Testing your Consent Mode configuration

Always test your changes using GTM's preview mode to ensure everything works as expected.

  • Testing default opt-out behavior in EU
    • Use a VPN to simulate an EU location (e.g., Germany)
    • Open your site in GTM preview mode
  • On the CMP popup, click Reject All
  • Use Google Tag Assistant to verify:
    • Tag Assistant can be assessed via the link above, or through your GTM account by clicking the Preview button in the top right corner of the UI
  • To check that Tags associated with vendors did not fire, you can view the GTM event history as seen in the screenshot below and check for the Trigger Group, if it is missing from the list, then it did not fire the associating tags
  • Testing default opt-in behavior in US
    • Disable VPN or set it to the United States
    • Open your site in GTM preview mode
      • You must enter your homepage URL to see the Do Not Sell link from Raptive
  • Verify:
    • Scroll down to the bottom of the homepage to find the link below, this confirms that Raptive has not detected an opt-out signal. (footer should read: “Do not sell or share my personal information”.)
  • If you completed Step 2, you should see a Trigger Group event. Clicking into it, you should see the Tags Fired section with your tags associated with vendors included. When you opt-out via the footer text, these will not fire.
Was this article helpful?
0 out of 1 found this helpful
Have more questions? Send a message

Want to join Raptive? Apply here!