Search the DG Knowledge Base
Google Tag Manager (GTM) is a popular tag management platform which allows you to centrally manage advertising vendors and how they are deployed to your web sites and mobile devices. Evidon Universal Consent Platform (UCP) supports GTM. This document describes how to deploy the UCP scripts through GTM as well as how to implement consent mechanisms to comply with various regulations such as the GDPR.
The Evidon UCP supports consent at various levels: broad, or complete, category-level, or vendor-level. If you offer just the consent choice of yes or no from your customers, you can hook our general consent event to be notified when advertising tags are permitted. If you support users consent at the level of category groupings (e.g., "Advertisers"), you can retrieve that information from our consent event and enable the appropriate tags. Additionally, you can offer specific vendor support, allowing customers to consent to specific vendors. That is supported as well.
This document assumes you already have a working knowledge of both the UCP and GTM, so it does not cover the configuration of your UCP implementation (for more details, refer to UCP Documentation) Or the basics of GTM. Instead, the focus here is on how to deploy UCP through GTM and support various consent levels.
This section of the guide explains how to configure GTM to leverage these new features.
Note: This article is not a comprehensive guide to Google Tag Manager. For more detailed information on setting up and using GTM, please refer to the official Google Tag Manager documentation.
The following are some definitions for terms used in this document.
Prior Consent: The act of gaining consent from users before allowing advertising or tracking technologies to execute.
Tags: The mechanisms used by advertising and tracking companies. Typically, these are JavaScript files but can also be things like image drops.
Vendors: Another name for companies who perform advertising and tracking functionality.
Consent Wall: A way to describe the “barrier” put in place to hold tags which require consent from executing until consent is gained.
EvidonConsentGiven: Evidon first party cookie that fires when implementing a Consent script.
Basic Consent Mode: Adjusts how Google tags work based on user consent for cookies. It offers a simple way to handle consent for essential functionalities like Analytics and Ads without detailed customization.
Advanced Consent Mode: Provides more granular control over how consent is managed and applied. It allows for detailed configuration and integration with various consent management platforms (CMPs), offering advanced options for handling different types of user consent and adjusting tag behaviour accordingly.
For more information, see Google Consent Modes
While this document doesn't cover the complete setup of the UCP platform, we will take a moment to guide you on how to enable support for Category and Vendor consent.
Support for more granular consent is enabled at the Theme level within your consent platform. The following instructions will guide you through the process of enabling this support within a theme.
Once you have enabled the new version of the dialog, you will want to verify the styles look the way you want.
This is a picture showing the correct option to enable
(Prerequisites)
The first step of this integration is added a “Evidon - Universal Consent Platform” from the pre-defined gallery of the Google Tag Manger.
To add the "Evidon Universal Consent Template" using a different method, follow these steps:
Once the template is loaded, you'll have access to its user interface with a few configuration options:
After adding the “Evidon - Universal Consent Platform” from pre-defined gallery the next step will be adding the Evidon Scripts.
Two ways to adding Evidon Scripts and configure GTM for Consent
There are two ways to set up GTM for consent
When logged in to UCP
One the file is downloaded, log into your GTM instance. Follow these steps to import the Json file
Please ensure you place the GTM header script as the first script in your source code to ensure any other scripts on your source code that fire cookies on the website are loaded after Evidon.
Once complete, your triggers are set up. The final step is to assign the correct load rules to the tags.
To support category consent on your tags you need to set up the tags to have the correct type of category consent assigned to them.
To support vendor consent on your tags you need to set up the tags to have the correct vendor consent trigger assigned to them.
Remember, triggers on a tag act as an “OR” condition, so if either of them execute the tag will fire.
Once you have set up the tag and saved it, it should look something like the following:
If you also want to deploy the Evidon UCP tag through GTM that is easy to set up. Just create a new Tag in your GTM platform and add in our script. Here are some detailed steps:
Here is an example of how this should look:
This will add the Evidon tag to your implementation and instruct it to drop on every page load.
Using Events and Scripts Properties
For more control over the creation of triggers rules, you can follow these steps instead of the recipe. Before you begin setting up consent support you need to have the following:
You also need to be prepared for this to take some time and effort. The odds are you have not been configuring your GTM implementation with consent in mind and this may require a substantial amount of rework. It is entirely possible you will need to re-work your entire GTM setup. This is unfortunate, but it is a sign of the times we are living in now. Trust us, you are not alone with this pain.
This section describes how we communicate consent through the GTM data layer. If you are a GTM guru this is likely all the information you would need to set up your tags and triggers. Even if you aren’t, it is important to know how we communicate consent to the tag manager.
dataLayer.push('evidonConsentGiven', consentCategories:'', consentVendors:'');
The category names in the consentCategories are the names you have assigned to your Category Buckets in the privacy application where you configured those. If all categories are enabled the only value in the string will be 'all'.
The vendor names in the consentVendors are the permanent string identifiers we use for our vendors. If all vendors are enabled the string will be 'all'.
GTM Nuances
If you haven’t set up sophisticated tag rules before there are a couple of things to be aware of.
On Triggers you can set up multiple “fire” rules that behave together, so they all need to be true for the trigger to fire. We refer to this as “AND” logic, because each condition needs to be met.
On tags you can set up multiple triggers, but these behave as “OR” conditions. In other words, if any trigger is met the tag will execute.
What does this mean to you? You need to be careful about the triggers assigned to the tags that need to be behind a consent wall. For example, you cannot put on the Page Load trigger for any of them because that will always be true, and the tag will drop before consent is received.
Our recommendation is for you to create Tag-specific triggers for all tags that need consent. This may seem like a lot of work, but if you are doing vendor-level support it is unavoidable and even if you aren’t it is probably good practice. But tag-specific triggers will allow you to put on multiple trigger conditions such as consent, and a button click or form submission. It will also allow you to more easily transition into vendorlevel consent support if you need to in the future.
This section provides a sample setup for each type of consent you can support: blanket, category, or vendor level consent.
Blanket (all or nothing) Consent
This is the most basic type of consent. Effectively you just look to see if the user provided consent or not, and then execute the tags behind the consent wall on the consent event received. This type of consent ignores the incoming categories and vendors.
To support consent, you need to set up a trigger that receives the consent and can be assigned to the tags that need to be behind the consent wall. Here are the steps we recommend creating the trigger:
The configured trigger will look something like the following:
For all your tag vendors who need consent you will need to add this trigger.
If you are providing your users the ability to consent to specific categories, you can support that within GTM using the Evidon UCP consent support. When our tag triggers the consent event we include the list of categories the user has consented to. This is a comma-separated list of the category names you provided within the Evidon Privacy Application when you configured your Category Buckets.
This list will look something like the following: advertisers, social media, analytics, other
However, there is also a scenario where the site user just blanket consents to all vendor categories. When this happens the consent string will just contain the word: all
You will need to handle both scenarios in your consent configuration. This section will walk you through that configuration.
Create the Category List Variable
The list of categories will be passed in through the data layer as a variable. To work with this information in GTM, it needs to be assigned to a variable. This section will walk you through creating the variable to hold the consented categories values.
It should look like the following:
For category level consent you will need to create a Trigger for each category you have defined as well as one for the “All” category.
Here are the steps to create the all categories trigger:
Once you have set this up it should look like the following.
Now create the category-specific triggers. We are going to give you an example of how one of them would look, just repeat the process for all the categories you will support.
Here are the steps to create the category-specific trigger:
When you are finished it will look something like this:
To support category consent on your tags you need to set up the tags to have the correct type of category consent assigned to them. This section will walk you through setting that up.
Remember, triggers on a tag act as an “OR” condition, so if either of them execute the tag will fire.
Once you have set up the tag and saved it, it should look something like the following:
If you are providing your users the ability to consent to specific vendors, you can support that within GTM using the Evidon UCP consent support. When our tag triggers the consent event we include the list of vendors the user has consented to. This is a comma-separated list of the vendor level names you provided within the Evidon Privacy Application.
This list will look something like the following: adroll, google, mediamath
However, there is also a scenario where the site user just blanket consents to all vendors. When this happens the consent string will just contain the word: all
You will need to handle both scenarios in your consent configuration. This section will walk you through that configuration.
The list of vendors will be passed in through the data layer as a variable. To work with this information in GTM it needs to be assigned to a variable. This section will walk you through creating the variable to hold the consented categories values.
For category level consent you will need to create a Trigger for each vendor you have defined as well as one for the “All” to capture the all-vendor scenario.
Here are the steps to create the all vendors trigger:
This is an example of what this trigger would look like:
Now create the vendor-specific triggers. We are going to give you an example of how one of them would look, just repeat the process for all the vendors you support.
Here are the steps to create the vendor-specific trigger:
When you are finished it will look something like this:
To support vendor consent on your tags you need to set up the tags to have the correct vendor consent trigger assigned to them. This section will walk you through setting that up.
Remember, triggers on a tag act as an “OR” condition, so if either of them execute the tag will fire.
Once you have set up the tag and saved it, it should look something like the following:
Things to consider about deploying the UCP tag through GTM
You need to remember that everything is a trade-off for these scenarios. Using GTM makes managing your tags easier and makes deployment very simple.
But, for things like deploying the UCP tag through GTM it will add a bit more latency to the overall tag loading. This is unavoidable. If you deploy UCP directly onto your site pages, it will execute immediately as the page loads. If you deploy through GTM it will need to wait for GTM to load first and then pull down the initial set of tags to execute on page load. Since any tag behind the consent wall needs to wait for UCP to load, pull the settings, and look for consent (or show the consent interface) this will add latency to that whole process.
Testing
It is critically important you thoroughly test your configuration. This should go without saying, but we frequently encounter customer issues where one or more of their defined triggers doesn't work. We don't want some of your tags not executing correctly because of some minor misconfiguration somewhere. Because most of the triggers work off text inputs the odds of something like a typo happening are high, so definitely make sure all the paths are working.
To test:
Search our DG Forum to find answers to questions asked by other DG users.
No luck? Ask a question. Our Product and Support teams are monitoring the Forum and typically respond within 48 hours.