Skip to content

How to Set Up a Cookie Consent Banner with Google Tag Manager

Osman Husain 1/15/24 11:46 AM

Table of Contents

Installing a GDPR-compliant cookie consent banner with Google Tag Manager offers numerous advantages for website administrators and marketers seeking to enhance user privacy compliance while streamlining their website management processes.

In this article, we'll give you a step-by-step overview of integrating Google Tag Manager with Enzuzo's cookie consent tool, helping you efficiently deploy and control the cookie consent script without requiring direct code modifications.

This approach simplifies the implementation process and provides the flexibility to manage and update your cookie banner dynamically, ensuring compliance with evolving privacy regulations while maintaining a seamless user experience.

👉 Enzuzo's free, no-code tool makes setting up a cookie consent banner on any platform easy. Try it out today.

Furthermore, Google Tag Manager's robust version control and debugging capabilities empower you to fine-tune your cookie banner's behavior, ensuring it functions optimally without compromising website performance or user engagement.

You can set up the Enzuzo Cookie manager via Google Tag Manager in two ways:

- Using our Google Tag Manager Community Template
- Manually with a custom HTML tag

Let's explore both methods:

 

Installing a Google Tag Manager Community Template


Using our Google Tag Manager Community Template allows us to integrate with other tags in your Google Tag Manager installation and ensure that they remain compliant. Download our Community Template here before starting these instructions.

 

Step 1: Go to the "Templates" section of your Google Tag Manager workspace, and click "New".

 

gtm1

 

Step 2: Click "Import" in the three-dot menu in the top right, and select the file (template.tpl) you downloaded. Then, press "Save".

gtm2

 

Step 3: Go to "Tags" and click "New".

 

gtm3

 

Step 4: Give a tag a descriptive name, select the "Enzuzo Cookie Manager" for the tag type, and set the trigger to "Consent Initialized." 

 

gtm4

 

Step 5: Click on "Tag Configuration" and fill in the value for "Enzuzo Script URL." You can find this in the Enzuzo App, under "Cookie Consent" > "Add To Website". The correct value will start with "https://app.enzuzo.com." Be sure to enter it without quotes.

gtm5

 

Step 6: Ensure you have Google Tag Manager added as a service in your Cookie Manager settings, under "Cookie Consent" > "Manage Cookies". If it's not present, press "Scan My Domain" and then press the plus sign on the "Google Tag Manager" entry to add it.

gtm6

 

Step 7: Finally, press "Save" on your tag, and then publish your workspace.

 

Third-Party Scripts

The built-in Google Tag automatically integrates with the consent settings our template controls. However, if you are loading another type of tag, such as "Custom HTML", you must configure it to integrate with GTM's consent settings.

First, create a "Custom Event" trigger, by going to "Triggers" > "New" > "Custom Event". In the "Event Name" field, type "enzuzo_consent_update".

gtm7

 

When creating your custom tag, use the new "Custom Event" trigger you created. Then, click on "Advanced Settings" > "Consent Settings" > "Require additional consent for tag to fire", and then specify a category. Your tag will then fire when the user consents to the corresponding category in the Enzuzo Cookie Banner.

gtm8

 

Setting up a Cookie Consent Banner With a Custom HTML tag

If you can't use our community template, you can manually integrate the Enzuzo Cookie Manager into Google Tag Manager.

 

Step 1: Log into Google Tag Manager and click on "Tags" in the sidebar, followed by "New." Doing so will bring up the following popup:

manual1

 

Step 2: Name your tag something meaningful, like "Cookie Banner Script Tag." Click on "Tag Configuration" to start the tag setup. A dialog will appear asking you to choose your tag type, click on "Custom HTML"

 

manual2

 

Step 3: In the Tag Configuration view, you will see a text box where you add the cookie banner embed code. Additionally, open up the "Advanced Settings" and ensure "Tag Firing Options" are set to "Once per page"

manual3

 

Step 4:  Now set up the trigger to load the cookie banner onto your website. Click on "Triggering" and click the "+" icon to create a new trigger. In the dialog that opens up name your trigger and click on "Trigger Configuration". In the trigger type dialog, select DOM Ready and ensure "All DOM Ready Events" are selected.

 

manual4

 

Step 5: After you have completed the triggering setting, you will be brought back to your tag configuration where it should look something like this:

 

manual5

Step 6: Click on save to see your new tag listed in the tag breakdown. It should look something like this:

manual6

 

Congratulations! You have now finished configuring your Enzuzo cookie banner to load with Google Tag Manager. All that remains is to click on the "Submit" button in the top right of the Google Tag Manager screen to publish your new tag.

 

👉 Need Expert Help or Advice? Reach out to us in Live Chat or Book a Demo!

Osman Husain

Osman is the content lead at Enzuzo. He has a background in data privacy management via a two-year role at ExpressVPN and extensive freelance work with cybersecurity and blockchain companies. Osman also holds an MBA from the Toronto Metropolitan University.