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.
This guide provides the detail for integrating Google Consent mode with the iubenda Cookie Solution template.
You can follow this guide if you want to set up Google Consent mode without using the template.
First, you have to create a GTM account and set up a container.
Then, you’ll be required to paste the GTM snippet into your website’s <head> section.
Finally, you’ll reach the GTM dashboard.
Once in the dashboard, click on Add a new tag.
Then, click on the Tag configuration area, select “Discover more tag types in the Community Template Gallery”, click on the magnifier icon, and search: iubenda
Select “iubenda Cookie Solution” and click “Add to workspace” to add it to your GTM installation.
Before setting up the template, you need to import it. Here’s how:
Once back in the dashboard, click on Add a new tag.
Then, click on the Tag configuration area, scroll down to the Custom section, and click on iubenda Cookie Solution to add it to your GTM installation.
Once you have added the template, you will get to the Tag configuration page.
Here you will have to:
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 user’s part, so we suggest being extremely careful in modifying such parameters.
For more information about Consent types, you can check the Google official documentation here.
denied(Targeting & Advertising purpose). It can be used to send event and session-based analytics (including conversions) without cookies across pages.
You can see the official Google Tags documentation for further information about these parameters.
In this part of the process, you can embed the 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 (strikethrough)
You can also embed the Cookie Solution code manually. To do that, you have to follow the standard embedding method described in this guide.
❗️ To make sure this method works correctly, remember to add the parameter:
googleConsentMode: template to your Cookie Solution configuration.
Finally, you can choose the Cookie Solution channel (Beta, Current, Stable).
In this section, some advanced settings can be set up, such as the Tag firing priority, Tag Sequencing, and advanced Consent settings. Please note that there’s no need to edit these settings for the template to work, so if you’re unfamiliar with them, you can ignore them.
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.
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!