How to get Consent Mode v2 via Google Tag Manager

Blog
What would be the best way to get Google Consent Mode v2 implemented? Are you already using Google Tag Manager? Then, Implement Consent Mode v2 via your Google Tag Manager. At least if you want to go with the advanced mode of Consent Mode v2. And here's how to do that.
Table of Contents
Google requires you to respect your visitors’ right to privacy and adhere to their EU User Consent Policy.
How?
By not sending them specific data about people who do not want you to do that, i.e., visitors that push “no” on your cookie banner.

Google also wants you to be able to get as much as possible from your Google Analytics and Google Ads accounts. So they first invented Google Consent Mode—and then Google Consent Mode v2. The latter is a big deal since Google has given you until March 2024 to get the updated version.

Or else … 
I recommend this article if you want to learn more about Google Consent Mode v2. In the post you’re reading now, we’ll focus on how to get Consent Mode v2 via Google’s Tag Manager.
You can also get a video demo by signing up for this on-demand webinar, where web analytics expert Lars Friis shows you step-by-step how to implement Consent Mode v2 via Google TagManager.

Why use a CMP to get Consent Mode v2 via GTM?

You can always build your own CMP solution and then create your own Consent Mode v2-tag template.
But one of (the many) benefits of getting an established and certified CMP is that you (also) get that last part “on the house”, i.e., the tag template, without having to write a single piece of code. All you have to do is choose it in the Google Tag Manager (GTM), then go into it and calibrate those default consent states.
Easy peasy. 
Or, as Google puts it , “This ensures optimal functioning of Google and third-party tags that support consent mode”.
But note that when you implement Consent Mode v2 via a template in Google Tag Manager, you are implementing the advanced version, not the basic version. More on that at the end of this post. 

How to get Google Consent Mode v2 via Google Tag Manager

For the record, you can also choose to implement Google Consent Mode v2 via a WordPress plugin or by inserting the script directly onto your website. What you choose is up to you and your specific needs.
What you can not do is implement Consent Mode v2 without a Consent Management Platform (a CMP), like, for example, Cookie Information’s CMPor, by all means, your own home-made CMP.

So before you run into your GTM, you have to make sure you have a CMP account, preferably a CMP certified by Google, like, for example, Cookie Information’s CMP. If you don’t have one, it’s easy to fix. Just go here and try one for free for 14 days—no strings attached.

Let’s say you have your CMP account now. Then here’s an overview of what you need to do:
  1. Go to Google Tag Manager and create a new tag.
  2. Add Cookie Information’s tag manager template to your workspace.
  3. Configure your tag settings.
Let’s break down this in more detail.

And take note: With Consent Mode v2, you must use gtag.js or Google Tag Manager. If you have the older tag-versions (like ga.js or analytics.js), you must update to the latest tag-version before doing anything else.

Step 1 — Get the Tag Manager Template

First, you must go into your Google Tag Manager account/dashboard and open the Tags 
Menu. 
Here, you click “New”. 
Make sure you give the “New” tag a name—for example, Consent Mode v2 with Cookie Information.
Then click on “Discover more tag types in the community template gallery.” When you get there, search for our tag template, “Cookie Information Consent Mode v2.”
All good?

Ok, then select it and click on “Add to Workspace.”

Step 2 —Configure your tag Settings

Then you go to “Default Settings” and add and adjust each row—meaning consent types—one row for each consent type. All in all, there can be 7 consent types, plus the row for regions/language.
Note that 1 and 3 are the two new tags unique for Consent Mode v2.
Note that 1 and 3 are the two new tags unique for Consent Mode v2.
  1. ad_personalization (marketing cookies)
  2. ad_storage (marketing cookies)
  3. ad_user_data marketing (marketing cookies)
  4. analytics_storage (statistical cookies)
  5. funcationality_storage (functional cookies )
  6. security_storage (necessary cookies)
  7. personalization_storage (functional cookies)
Note that all consent types are set to “denied” per default, meaning they will not be fired before the website visitor has given their consent—i.e., answered yes to that specific cookie category on the consent banner.
Also, note that you can change this default “denied” behavior and add different geographical regions by clicking “Add region” under the “Default Consent State”-section. Some regions may have more lenient privacy regulations, which could allow for that. 
If you leave the Region row blank, the consent settings will be the same for every region.
Cookie Information automatically maps the 7 consent types to the 4 different categories in the cookie banner that comes with Cookie Informations CMP. 
  1. Necessary Cookies
  2. Functional Cookies
  3. Statistical Cookies
  4. Marketing Cookies

Should I do something in the Advanced Settings in the GTM set up?

As mentioned before, one of the new aspects of Consent Mode v2 is that you can implement it in an Advanced or Basic Version.
The Basic version blocks the tags entirely before consent. The Advanced version sets them before consent is given. Is the advanced version 100% compliant with privacy regulations? If you’re hesitant, consult your Data Protection Officer (DPO) or a tech lawyer who can help you assess it.
If you choose to implement Google Consent Mode v2 with the Google Tag Manager template, as described here, then you choose to run with the advanced mode. 
This is quite important to keep in mind. If you want to implement Consent Mode v2 basic mode, you can do it by inserting the Consent Mode v2-boosted script for your CMP.
So it is easier to go with the basic mode if you feel that that is all you need.
Read more about how to get the basic version in this support article. It covers all implementations, so locate the script version when you go in there.
But to just explain it really short, when you get our CMP and know that you only want the basic version, then you implement the smaller CMP script, which has been adapted for Consent Mode v2 by us adding this small string: 
data-gcm-version=”2.0″
That’s it.
Ok, sorry for the detour.
Now, all you have to do to get your Consent Mode v2 setup in GTM is select “Advanced Settings, ” where you go in and add a time frame for when the tags are to fire.

Note that “Advanced Settings” does not refer to “advanced mode”, since the entire set up via the GTM is the advanced set-up.

Time is measured in milliseconds, so if you want the tags to fire 1,5 seconds after consent has been given, then you write 15000.
It’s time for consent mode to start rolling after a visitor has said yes to cookies on the banner.
After this is done, you click on the Triggering page”, where you select the triggering type to:
“Consent Initialization”.
Then you save and preview to test your tag.
If everything looks fantastic, you can go ahead and click “Submit.”

And you’re done! Now you can continue to use remarketing, automated bidding strategies, and more, even after March 2024.

Congratulations.

But what about the cookie-banner - will the GTM setup ensure it gets up?

Yes, you do not have to go out of the GTM setup to get the actual cookie-banner up on your site. 
In the Google Tag Manager, all you have to do is check the box for “Add Cookie Information, Consent Banner.”
But if you already have the right Cookie Banner inserted into the source code via the so-called uc.js-snippet, then there is no need to check that box. Regarding the dropdown menu för language. It controls the language of the consent banner. If you want to change the language dynamically, then do not use this setting. Instead take a peek at our more comprehensive support article here.
What is the right Cookie-Banner?
The right one is “Overlay 2” or the “Overlay 3”.
Go here and select either one of them to see how they look.
If you, for some reason, want to add the cookie-banner template manually, then make sure it has the custom attribution “data-gcm-enabled=false.”
For more details about that, see this support article

The fastest way to get Consent Mode v2 implemented

The fastest way to get the latest version of Consent Mode v2 up and running is with a consent management platform (a CMP), such as Cookie Informations CMP.
Thus, if you do not have an active CMP on your site today, the first thing you need to do before heading to your Google Tag Manager is sign up for one.

We offer a free 14-day trial with no strings attached if you want to get Google Consent Mode v2 up as fast as possible on your WordPress site. Or at least in time for Google’s March 2024 deadline.

So begin by signing up to our CMP now.