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)
- Raptive collects user consent via the CMP.
- A consent signal is pushed to the data layer.
- GTM reads that signal.
- 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 Important: if you need GA to be completely blocked (not just modified) before consent in the EU, you also need to complete our separate guide on delaying GA. |
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 GTM, go to Templates > Search Gallery and install the ConsentManager tag template. Raptive partners with ConsentManager for the consent mode feature; they are an authorized partner
- Click New to add a new tag to apply the template to
- Next, click the Tag Configuration section to add the template.
- Click the Search icon
- Search for Consentmanager
- Click Choose Template to add the template to your GTM account
Configure the template
-
Triggering: Set the trigger to Consent Initialization
-
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.
- CMP details: The tag setup may require that you insert a Consentmanager.net ID, Consentmanager.net host, and Consentmanager.net CDN. Request these details from your Raptive support team if you have not done so already.
-
Enable Google consent mode: Ensure this box is checked in the template configuration.
- Timeout: Set the timeout to 1500.
-
Consent mode defaults: Ensure all checkboxes under "Consent mode defaults" are unchecked. This indicates that no consent is assumed.
Naming and execution order
- Name the tag (e.g., Raptive Consent Tag Manager)
- Save and make sure your trigger group is set to Consent Initialization, so that this tag fires first
- This step is critical so that user consent preferences are available to other GTM tags before they execute
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 the cmpConsentVendors variable
- Go to Variables > New
- Click this button in the Variable Configuration section to start creating a new variable
- Set Variable Type to Data Layer Variable
- Set the name to cmpConsentVendors
- This variable contains the list of vendors you want to check for consent on your tags. This should be mapped from the prerequisite step above
- This variable contains the list of vendors you want to check for consent on your tags. This should be mapped from the prerequisite step above
- This variable will contain a comma-delimited string of consented vendor IDs (e.g., ,s26,s91,s105,).
- Note: The leading and trailing commas are required.
In the next section, you will create a Trigger that will call your tags when user consent has been collected.
Create triggers for vendor consent
- You will create a reusable trigger that fires only when consent has been given for a specific vendor, or list of vendors.
- Go to Triggers > New and create a Custom Event Trigger
- Set the Event Name to: 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.
- 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.
- Add a Condition:
- Variable: cmpConsentVendors
- Operator: contains
- Value: Include your partner’s vendor ID with leading/trailing commas, e.g., ,s38,
- Repeat this for each vendor you want to control tags for
Step 3: Connect triggers to tags
With the variable and trigger created, you can now enforce consent on your existing 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 > Trigger Group
- Add:
- The existing trigger
- The vendor-specific consent trigger (e.g., cmpEvent with ,s26,)
- Save the Trigger Group
- Update the 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
- 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”.)
- 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.