Set up Consent Mode V2 with any cookiebanner in GTM

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
do you want to set up consent mode version two on your website in last week's video I went over the steps on how to do this in cookie bot but that video might not apply to you because you might use a totally different cookie Banner or content management platform well in this week's video I want to show you how to set up consent mode version two with any cookie Banner that is available and we're going to set it up with Google tech manager let's Dive In hey and welcome to the channel my name is Leon this channel exists to help you use your web stats in order to improve your website without wasting hours in the process I want to thank everyone that has been liking my videos and has subscribed to the channel because that really helps me get these videos out to as many people as I can and as a way to say thank you I have created a short cheat sheet on how you can grow the traffic that is coming to your website so if you're interested in growing the traffic to your website head over to the video description deson to download that cheat sheet for free also if you like this video and you want to watch more just head over to my profile because I have created tons of videos over the past year on how to set up Google analytics and how to use that data in order to improve your website all right so we're talking about consent mode version two consent mode is the technology that takes the preferences of your user and applies them to the individual Tex in your Google tech manager container so a site visitor might come to your site and then click refuse well here in the Netherlands under the gdpr it is not allowed to set marketing TXS when people do not give consent for that so consent mode lets you fire or not fire TXS based on the consent settings that people give through the cookie banner and I have uh the free version of cookie bot installed on my site right here it is not customizable because I'm not paying for it but it'll do as an example and you might have any cookie Banner it doesn't matter if you have cookie bot or a different content management platform or even a customade cookie Banner that your web designer built for you because in this video I'm going to show you how to set up conent mode version 2 with any cookie Banner that is available so before we dive into the content of the video I want to do a small check first so let's go into Google tech manager because I want to make sure that consent mode version two or whatever version is available is not already set up through some other technology because there are multiple ways to set it up and sometimes it is already working even though you might not realize it or it is working but it is not working properly so let's hit preview so I have already uh the Tex assist open here and then my site is right here and then I'm going into the tech assistant and I'm going through the messages from one to the end which is six right here and um I'm going to open up the consent window and here I see the message consent not configured and this is a confirmation that consent mode is not set up on this site yet you might have cookie Banner that kind of automatically sets up consent mode you probably do not want to do this twice so this is just a way to verify that there's not something else already in motion all right now that we've verified that content mode is not yet set up on our website we need to do some research because the preferences of your site visitor like do they allow all cookies or do they refuse cookies those preferences are usually stored in a cookie or in a similar technology and where those preferences and how those preferences are stored is different for every cookie Banner so cookie bolt stores it in a different way than some other cookie Banner so we need to do research on where and how it is stored in order to set up conent mode well let me show you how you do this research so I'm going to go into my site I'm going to say allow all cookies well now I have given my cookie preferences I want to find out where these preferences are stored by the way I'm using the Google Chrome browser this might also work in different browsers but if you want to follow along maybe it's best to use the same browser I'm going to rightclick on my page and I'm going to say inspect please do not feel overwhelmed by all the HTML code it is really not that hard we're going to take a look here at the top section where you have different tabs and we're going to go in this application tab right here and under the application tab you have a section that's called storage and then you have a section that's called cookies and usually the preference of your user the cookie preferences are stored under cookies or under local storage and I would say 80% of the times it is stored under cookies so we're going to go under cookies first I'm going to look under my own domain that is really important so you might see a bunch of domains but you need to look for your own domain and that will give you a list of all the cookies that are set up on your own domain and the First Column is the cookie name and we're going to look for a cookie with the name cookie in it or consent or Banner so the name is different for every type of cookie Banner so that is why we're doing this research but we're going to look for something with the name consent or cookie in it if I go through the cookies this row cookie consent this is probably the one that I'll need so I'm going to open up a small text file right here and I'm going to remember some of the things so the technology is cookies because I found it under cookies and not under local storage so the technology that is used is cookies the cookie name is Cookie consent so I'm going to double click to copy this and I'm going to paste it in my notes and the content of the cookie I'm going to double click or no I'm going to copy it from here because it's uh decoded that makes it a little easier to read yeah there you go so this is the content of the cookie and if I'm going to analyze it right now already that I'm going to inflate it a little bit but you'll see that necessary is through preferences is true statistics is true marketing is true so all the different categories that are available inside of my cookie Banner are also stored in this cookie so you might have a totally different cookie Banner what I sometimes see is that cookie banners have set a cookie that has for instance a name cookie consent and then for instance the content says true that's totally fine as well so your cookie Banner might be totally different it doesn't really matter or even you might not find a cookie that has cookie consent in it then you need to look under local storage and then again under your own domain so you might find something in this column right here where under key it says something with cookie consent well same thing here so then the technology is local storage and that is important to remember because the method for retrieving the cookie is a little bit different the name might be something like cookie undor consent and then the content might be something like true or marketing true something like that the important thing here is to do research on how the content on your site is stored and this is different for every different content solution all right now that we've done our research let's go back into Google tech manager to set up consent mode version two I'm in my Google tech manager container under tanks I'm going to create a new tag right here I'm going to give it a number I'm going to say consent mode default by the way I have a very particular naming convention inside of Google tech manager to structure my container I have made a separate video on that I'll link it down below if you're interested but this is just for structuring the container it is not doing anything and then under the tech configuration I'm going to open this up and I'm going to click through to the community template Gallery because inside of this template Gallery there is a template that is called consent mode so I'm going to click this um search icon right here I'm going to look for consent mode and then here I'm using this content mode template by Simo aava I'm going to click it and I'm going to add it to my workspace yeah yeah go ahead so now that we've imported the consent mode template into our Google tech manager container we need to fill this out for the first time and this time we're going to set some defaults so these are the settings that are applied whenever someone lands on your site and has not yet decided do I want to refuse cookies or do I want to allow all cookies so these are the settings that are applied before someone gives consent and what you fill out here depends on where you live or it depends on the the target audience like what countries am I targeting with this website well my target audience and my website is aimed to boards the Netherlands so I'm going to fill out the settings that apply here but please be careful please do some research on your country this is not legal advice so if you have any questions please consult a lawyer so I'm going to go in and fill this out for my site at storage is of course not allowed here in the Netherlands under gdpr so unless you have content well this is the default we do not have have consent yet so this I'm going to set To Deni analytic storage in the Netherlands is still allowed under some strict rules I know that my site lives up to these rules so I'm going to set this to granted so I'm going to track analytic storage whether I have consent or not at user data at personalization I'm going to set to denied again because I do not have consent yet and I need consent to track this information these three categories I'm going to set to granted and under other set I'm going to enable pass at click information through URLs this is a clever trick that lets you keep some parameters in the URL when people navigate to the next page and for instance accept cookies there you still be able to keep some of that information redact at data is a good setting that lets you improve the privacy of your users a little bit and as a trigger this is really important under triggers I'm going to go into triggers and I'm going to set this to consent initialization so this is probably the most important thing in your content setup this is the very first trigger that loads and this will make sure that the consent is set before anything else is uh initialized in your container so I'm going to set consent initialization all pages as a trigger on my consent mode default tag and now I'm going to hit save all right so we've already applied the default consent settings to our Google tech manager container it is right here consent mode default but now comes the hard part we need to actually apply the actual preferences like after somebody has given consent or refused cookie consent we need to apply those preferences as well to our Google tech manager container and there are two things that we need to do here we need to set up a couple of variables and we need to set up a tag and I'm going to take you through this process step by step all right let's look at variables first we're going to scroll down here to the section that says user defined variables and we're going to open a new variable and I'm going to call this cookie consent and here we need to reference the notes that we made in the previous section so let me go back into my site real quickly if you right click on your site and go into inspect and then open up the application tab maybe remember that sometimes the content settings are stored in a cookie right here and sometimes the content settings are stored in local storage right here and I've made my own like test case right here where I have consent cookie consent and then yes this is different for every cookie Banner so you need to look through the list and look if you find your content settings somewhere here let's go through those two cases so first if you have your content settings stored in a cookie we go into Google tech manager and we're going to make a variable with the name first party cookie and then as a cookie name I'm going to copy either from my notes so I have made it here in my notes but here under cookies I have this cookie name right here I press double click and I'm going to go back into Google Tech manager and use that cookie name right here and please check if you have the same cookie name or a different cookie name because this cookie name needs to match the cookie name that's on your site I'm going to click URL decode cookie and I'm going to hit save so this is the scenario where the content settings are stored in a cookie let's also go over the scenario where your content settings are stored in local storage if you go into local storage and you find for instance a key with the name cookie consent I'm going to also copy that go into Google tech manager this scenario also I'm going to need to make a new userdefined variable I'm going to call that cookie consent I cannot use the same name so I'm going to append the name local storage here you do not need to do that but as an example I'm going to use it right here as a variable type I'm not going to use the first party cookie but I'm going to use the custom JavaScript variable type I'm going to use a small piece of code here which I will put in the video description for you to reference it looks like this function and then return local storage and then in these brackets I need to put the name by the way it says get item and then cookie consent so again I will put the link in the video description to this small piece of code you can copy that please change this piece of text to the key that is uh where the content settings are stored on your side because this changes depending on your cookie Banner okay I'm also going to hit save so we're not yet done here I'm going to make a new variable right here as well and I'm going to call it lookup and then add storage I'm going to open up the variable configuration and I'm going to look for the Rex table yeah it's right here I'm going to set a default value to denied so this variable is going to return denied every time except for one case as an input variable I'm going to select my cookie consent of course if you're using your local storage please look for that variable and then I'm going to say in some cases it can return granted and um here is when I need to open up my notes because this is how the content settings are stored with my cookie banner and again this is different for every cookie Banner so you need to look for your unique situation but here I know that marketing and semicolon through this piece of text is a signal for me that a user has given consent so every time a user gives consent I will find this piece of text inside of the cookie so I'm going to paste the pattern in here so there's a special character and because we're using the Rex table I'm going to do a back slash right here this is um just good practice every time you're using Rex and um under advanced settings there are a couple of things that you need to do here otherwise it won't work or won't work properly I'm going to disable full matches only and I'm going to disable capture groups all right this is it by the way I could make a lookup table for analytics storage as well so it would look a little bit like this analytics storage and then instead of marketing semicolon through I would do statistics semicolon through and I could retrieve the analytic storage permissions as well but I'm going to keep it to add storage for now so you'll be able to build from there I'm going to hit save and now I have everything that I need to make it to the last step required in this process and the last step is that we need to go under text and we need to make a new tag in our list I'm going to call it 9803 cons ENT mode update and this is where we apply the consent settings after somebody has given or denied consent so we're going to go into tag configuration this time we do not need to go into template Gallery because we've already imported the consent mode template in our container so we just have to look under the section custom and here it is consent mode Google text this time we're not using the default command but we're using the update command and uh here is where we're going to use the variable that we've just made so add storage I'm going to say lookup add storage so this is going to return denied or granted based on the preferences that the user has given analytic storage can be granted in any situation on my side but if you have made your own separate lookup table for analytic storage you'll need to set that here add user data I'm going to set that to the same variable look up add storage add personalization same thing look up add storage personalization I'm going to set that to granted functionality and security as well again I'm going to use the same settings that I have used earlier so pass at click information through URLs and redact add data and as a trigger I'm again using the consent initialization all pages trigger I'm going to hit save and now I've done everything necessary to implement consent mode version two the only thing that I still want to do is to test if the setup is working so to test if the setup is working I'm going to go into my site I'm going to go under application I'm going to go into the cookies and I'm going to delete the cookie consent cookie because I want to check what is happening if somebody lands on the site for the very first time of course cookie Banner returns because I've deleted all my content settings I'm going to go into Google tech manager I'm going to hit preview and we're going to see what's happening so I've not yet given consent the cookie Banner is still here I'm going to go into Tech assistant and I'm going to go through the messages right here to see what is going on and um on the message one I'm going to go into consent consent not configured then you have consent initialization set and then consent so here is where all the on page defaults are applied so denied granted denied denied granted yeah this is in line with what I've configured so again there's a set command so this is the second tag and again same conent settings apply here and then initialization tag so the current state this is in line with what I have configured there's no consent given yet for marketing cookies so all these categories are denied currently so I'm going to go into my site I'm going to click allow everything and I'm going to refresh the page to see what's happening yeah page has refreshed I'm going to go into the the second page here so under message right here doing the same thing just checking what's happening here so consent initialization set consent so this is the default which is still like the strict without advertising cookies those settings and then the second one is based on the settings that the user has given so I've allowed all cookies and here I see that all the categories are granted and then initialization so this is exactly what I want to see so now I have confirmed that this scenario is working so the last thing that I want to check is what happens in the scenario where people refuse all cookies I want to check and verify that the consent settings are also applied well in that scenario so I'm going to right click inspect go into application go into cookies and then remove the cookie consent settings one more time so the cookie Banner pops up and we have a blank slate so I'm going to refuse all cookies I'm going to refresh the page and I'm going to see what happens in this scenario so I've refused cookies I'm going to go into the tech assistant and I'm going to go through all the messages that I have here so right here under the consent tab I'm going to go through the messages and I'm going to see what's happening so this is the first consent message and it says granted denied to the advertising cookies ad stores so I verified that the defaults are set correctly and then the second message sets the ad storage and the add user data at personalization also to denied so this is how I verify that when people refuse cookies those preferences are also applied to the container so now that content mode is working on your site you need to apply these settings to the individual tags and this is the last step in setting up content mode on your website the first thing that I really like to do is I like to go under admin and then under container settings there's a little checkbox right here that says enable consent overview I'm going to enable that I'm going to hit save and uh if you go back to your workspace and go into tags you'll find that there is a small little icon here at the top right corner this is called the consent overview and if you open this up you'll see a list of Texs in your container where it says consent not configured and we need to go over all these Texs to actually apply the content settings to these individual tags let's open up the G4 config tag right here you'll find that if you scroll down that the advanced settings section right here is already opened and then under content settings you'll see that these settings are also open by default and then here you have three options you have additional consent checks it's by default set to not set and here you can choose to say there's no additional consent required or I want to require additional consent well some Texs and basically all Google txts have some built-in consent checks for instance here this Tex already checks itself like is there permission for for instance advertising trackers or is there permission for analytics storage so the default consent checks are already sufficient in this case so I'm going to set this to no additional consent required and I'm going to hit save and I need to do this for every tag in my container so I'm going to go over every tag plausible there's no consent needed there so I'm going to set this to no additional consent required by the way this is a small little shortcut that you can use so you do not have to open up the whole thing just check it and then click here I'm going to say no additional content required matomo and pic Pro both require analytics stores so I'm going to say analy lytics storage going to hit save so I have a bunch of G4 event Texs so I'm going to select them all and these all have builtin consent checks already because they're Google texts so I'm going to set this to no additional consent required cookie bot consent mode they all have sufficient consent checks built in so I'm going to do the same thing no additional content required and I have a small piece of code that I'm using for analytics storage so I'm going to set require additional storage analytics storage I'm going to hit save and now I've applied the consent settings to every individual tag in my container and I see that consent not configured is empty and consent configured is all set and this is how you not only set up consent mode but also apply it to the individual text in your container and if you've taken all these steps if you've tested your setup you're safe to commit the changes to your website all right that's it for today I hope this video was helpful I hope it was clear if you have any questions please leave them down in the comments below also if you want to watch more just head over to my profile because I've created tons of videos over the past year on how to set up goog lytics and how to use that data to grow your website all right I hope you have a great day and I'll see you in the next video goodbye
Info
Channel: Leon Korteweg
Views: 29,910
Rating: undefined out of 5
Keywords:
Id: yZjGzfWDc0Y
Channel Id: undefined
Length: 23min 21sec (1401 seconds)
Published: Thu Feb 29 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.