GTM

How to implement Visible Privacy with Google Tag Manager.

Implementing Visible Privacy with Google Tag Manager

Visible Privacy offers a comprehensive solution for managing cookie consent on websites using Google Tag Manager (GTM). This guide will walk you through the process of deploying Visible Privacy on your GTM-enabled website.


Prerequisites

Before beginning, ensure you have:

  • Created a GTM account.
  • Set up a website container in GTM.
  • Added the GTM container snippet to your website.

To add the Visible Privacy consent banner to your website:

Download the Plugin

In Google Tag Manager, "plugins" are considered "templates". You'll need to download the Visible Privacy template (beautiful-consent-visible-privacy-cmp.tpl). You can find it here.

Go to the Templates section of your GTM, and click the New button under Tag Templates.

Import the Visible Privacy CMP template to your workspace.

Save the template as it is.

Create a new Tag.

Go to the Tags section, add a New tag, and select "Beautiful Consent - Visible Privacy CMP" as the tag type, under the Custom section.

Enter your Client ID

Under the Tag Configuration section, enter your Client ID from your Visible Privacy account in the "ID" field. It will have a format like XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.

Set a firing Trigger

Under the Triggering section, set the trigger to "Consent initialization - All pages".

Your new tag should look like this.

Deploy your new tag! 🚀


Google Tag Manager includes several features that work together with Visible Privacy to help you manage how tags behave in response to the end user's consent choices.

Specific tags (such as Google Ads or Analytics) have built-in consent checks. This means that these tags include logic that automatically changes the tag's behavior based on the user's consent state. No consent configuration is needed for this type of tag.


For a complete overview of the consent settings applied to all tags in your container, you can enable the Consent Overview from your container settings.


Create a Custom Event trigger

In your GTM container, create the following Custom Event trigger to be used in your GTM configuration:

  • Event Name: vp_gtm_consent_update
  • Event Type: Custom Event
  • Fires On: All Custom Events

Edit the consent settings for all tags that need to be configured with additional consent.

  • In the Tag Editor, go to Advanced Settings > Consent Settings.
  • Set to "Require additional consent for tag to fire".

Configure the tags you consider

To ensure the tag fires as soon as consent choices have been determined (either from a previous visit or from interaction with the banner), replace the normal "All Pages" trigger with the trigger created in step 1.