Iubenda logo
Start generating


Table of Contents

How to set up Google Tag Manager with the iubenda Cookie Solution template

Google Tag Manager (GTM) allows you to use already configured templates for your GTM installation to simplify tag configuration.
GTM provides a Gallery of templates that can be easily added to your installation. The iubenda Cookie Solution template is now listed in the Featured Community CMP Templates.

This guide provides the detail for integrating Google Consent mode with the iubenda Cookie Solution.

If you want to set up Google Consent mode without using the template, you can follow this guide.

How to start

First of all, you have to create a GTM account and set up a container.

  account setup

Then, you’ll be required to paste the GTM snippet into your website’s <head> section.

Finally, you’ll reach the GTM dashboard.

Adding iubenda Cookie Solution template (manual method)

Import the template

Before setting up the template, you need to import it. Here’s how:

  1. Download the template from here
  2. On your GTM dashboard, click on Templates
  3. Under Tag Templates click on “New”
  4. Click on the three dots icon at the top right of the page and select Import
  5. Unzip the file you downloaded and select the template.tpl file from the folder
  6. Click on Save at the top right of the page and close the template editor

Add the tag

Once back in the dashboard, click on Add a new tag.

Then, click on the Tag configuration area and select Featured Community CMP Templates from the list, or click on the magnifier icon and search: iubenda and click on it to add iubenda Cookie Solution to your GTM installation.

Tag Configuration

Once you have added the template, you will get to the tag configuration page.
Here you have to:

1. Set the default consent options

The defaults are all set to Denied to ensure the best privacy protection for your users. 
Keep in mind that several legislations (for example, the GDPR) specifically require that consent is the result of positive action on the part of the user, so we suggest being extremely careful in modifying such parameters.
For more information about Consent types, you can check the Google official documentation here.

Optional parameters

  • URL passthrough is an optional parameter useful to improve the quality of your measurements when ad_storage is denied (Targeting & Advertising purpose). It can be used to send event and session-based analytics (including conversions) without cookies across pages. 
  • Ads data redaction is a parameter that allows redacting Ad click identifiers sent in network requests by associated Google Ads and Floodlight when ad_storage is denied .

You can see the official Google Tags documentation for further information about these parameters.

2. Cookie Solution embedding

In this part of the process, you can Cookie Solution directly within the tag (recommended option) or manually.

If you choose to embed the Cookie Solution directly via the template, you have to copy your embed code from the iubenda Cookie Solution embedding section and paste it into the CS configuration box of the template

As you may notice, the code to paste is slightly different from the code included on your iubenda embedding page.

This is because only the configuration part (_iub.csConfiguration) of the embedding code displayed should be filled in this section.
Here you can find an example of the parts not to paste into the box (strikethroughed)

<script type="text/javascript">
var _iub = _iub || [];
_iub.csConfiguration = 
"banner":{ "acceptButtonDisplay":true,
"rejectButtonDisplay":true }}
<script type="text/javascript" src="//cdn.iubenda.com/cs/ccpa/stub.js"></script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/iubenda_cs.js" charset="UTF-8" async></script>

If you want to embed the Cookie Solution manually, you can read more in this guide.

Finally, you can choose the Cookie Solution channel to use (Beta, Current, Stable). 

Advanced Settings

In this section, some advanced settings can be set up, such as the Tag firing priority, Tag Sequencing , and the advanced Consent settings. Please note that there’s no need to edit these settings for the template to work, so if you’re not familiar with them, you can just ignore them. 

3. Triggering

After configuring the tag, you need to set up the trigger to make the tag fire. 
You can select “Consent Initialization – All Pages” as the trigger.

Publish the Container

After completing the configuration, click the Save button at the top right of the page. The tag is now ready to be published.
From the GTM dashboard, click on Submit at the top right of the page:

Finally, add a version name and description, click on Publish, and that’s it! The tag is up and running, seamlessly integrated with our Cookie solution!