English Posts

How to implement Cookies with Google Tag Manager and Cookiebot

how to implement cookie consent with google tag manager and cookiebot

In this post I’ll show you how o implement cookies’consent on your website with Cookiebot via Google Tag Manager.

This solution is totally free and easy to implement.

Let’s start!

Create an Account in Cookiebot

First step: let’s go to Cookiebot‘s website and create a new free account.

cookiebot website

Once you’ve added email and a password, your account’s created.

Add a Domain Name

Now we have to add a new domain name.

Let’s insert the domain name without https:// , as you can see in the image below:

insert the domain name in cookiebot

And Save.

Scan Domain to discover Cookies

Now we’re going to scan our domain to discover all the cookies.

Click on:

  • Cookie
  • Scan Domain Now
scna domain now

Cookiebot will start scanning all the cookies of your domain.

This process could be required some minutes or hours.

When it’s finished, you can see all the cookies.

Set up Dialog

Now we set up the template the users will see and interact on your websie.

Click on:

  • Settings
  • Dialog
click on settings and dialog

You can choose several option settings:

  • Template: choose the position of the template you want to set on your website;
  • Method: it shows you two possible option: Implied Consent (the users, who’ll ignore the consent dialog, will automatically consent to the cookies you set up) or Explicit Consent (the users have to interact with the template and choose one option if they want that it disappears);
  • Type: you can choose different settings option about which buttons showing at the users;
  • Buttons: choose which button you want to show at the users for accepting or rejecting the cookies;
  • Checkboxes deafult mode: choose which cookies per default the users will see checked;

Every time you want, you can see the Preview clicking on the button, as you see in the image below:

click on the preview button

When you click on the Preview button, it’ll show you the template at the bottom of the page.

Every time you want to change some settings, let’s click on the Preview to see the new graphic.

Set up the Content

Set up the text you want to present.

Click on Content to open the window:

set up the content

You don’t have to write the text by yourself.

Every box is already filled, so you can change the text or the language if you want.

Every box has the description of the cookies’ category (Necessary, Preferences, Statistics etc.)

You always can see the Preview every time changed has made.

Save.

GTM – Create the tag

Let’s jump into Google Tag Manager and star implementing the tag.

Click on TemplatesTag TemplatesSearch Gallery.

Let’s search “Cookiebot CMP” and click on ADD:

search cookiebot cmp

Now we create a new tag.

Click on Tags New. Search and select Cookiebot CMP

select the cookibot cmp tag

Once selected, you have to insert into the box “Cookiebot ID” the script ID from Cookiebot.

You can find it into Settings – Your Scripts. Copy and paste it in GTM:

copy and paste the script id

GTM – Create the trigger

Let’s insert a new trigger All Pages to trigger the tag in every page of your website.

Name the tag “Cookiebot CMP”.

It’ll appear like this:

the tag cookiebot in gtm

Save.

GTM – Control the Cookies

Now we have to set up the tag to fire (or not) them based on the users’choices.

In Google Tag Manager click on Template Variable Templates – Search Gallery and search for “Cookiebot Consent State” :

clicca su Template - Variable Templates - Search Gallery e cerca "Cookiebot Consent State"

Now let’s click on Variable – New and insert the “Cookie Consent State” variable. You can search it in the list:

cerca la variabile cookiebot

Here it is the variable we have inserted and called “Cookie Consent v2“:

come appare la variabile inserita

In order to control the cookies based on the users’choices, we have to associate several triggers within this variable:

We’ll create 3 different triggers with the following settings:

Trigger 1 – Marketing

Trigger settings:

Trigger Name: “Custom – Visitor Gave a Consent for Marketing Cookies“.

Trigger type: Custom Event.

Event Name: cookie_consent_marketing

Fire the trigger on: Some Custom Events

Conditions: Cookie Consent v2 (select this item which represents the variable created above) – contains marketing

Everything will look like this:

marketing cookie

This trigger means: if the user clicks on the “Marketing” checkbox and he/she confirms it, the tag will be triggered:

merketing cookie

Trigger 2 – Preferences

Trigger settings:

Trigger Name: “Custom – Visitor Gave a Consent for Preferences Cookies“.

Trigger type: Custom Event.

Event Name: cookie_consent_preferences

Fire the trigger on: Some Custom Events

Conditions: Cookie Consent v2 (select this item which represents the variable created above) – contains preferences

Everything will look like this:

preferences cookie

This trigger means: if the user clicks on the “Preferences” checkbox and he/she confirms it, the tag will be triggered:

preferences cookie

Trigger 3 – Statistics

Trigger settings:

Trigger Name: “Custom – Visitor Gave a Consent for Statistics Cookies“.

Trigger type: Custom Event.

Event Name: cookie_consent_statistics

Fire the trigger on: Some Custom Events

Conditions: Cookie Consent v2 (select this item which represents the variable created above) – contains statistics

Everything will look like this:

statistics preferences cookie

This trigger means: if the user clicks on the “Statistics” checkbox and he/she confirms it, the tag will be triggered:

statistics cookie

Cookiebot – Calssify your Cookies

In your Cookiebot account you can the list of all the cookies found non your website.

Each cookie is part of one category: Marketing, Statistics, Preferences.

You can simply change the category which belong the cookie as you can see in the image below:

change the category of a cookie

Conclusions

In this post I’ve showed you how to implement the cookie consent using Cookiebot via Google Tag Manager.

In your Cookiebot account you have the possibility to change several settings and the cookie’s category too.

With Tag Manager you set when a tag has to be fired with some rules using the trigger.

Have a good implementation!


You may also be interested in the following articles:

Track Data Studio Dashboards with one Property in Google Analytics and 4 Calculated Fields

Tracking Google Data Studio Dashboards with Google Analytics

How to solve the 5 million cell limit in Google Sheets

Schedule Emails in Google Data Studio

Find Query Parameters on Google Analytics

Query Parameters and Google Analytics

How to track Single Page Applications with Google Tag Manager

Cardinality dimensions in Google Analytics

The value (other) in Google Analytics

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *