Settings for Google Tag Manager (GTM)

This article outlines settings in the Peppered Platform related to the integration with Google Tag Manager (GTM).

GTM & Consent levels

Visitors of your website can give different levels of consent through a cookie banner. This can be a third party cookiebanner, or when using the included Peppered Cookie banner.

The Peppered Cookie banner uses four Cookie consent levels:

  1. undefined: the user did not supply a level of consent
  1. default: only cookies required for the Peppered Platform website to function
  1. limited: some cookies are allowed, for embedded content and anonymous statistics
  1. all: all cookies, including ad-tracking etc. are allowed
 

Different consent levels can trigger different tools in the Google Tag Manager. To properly set-up consent levels, check out the article.


Setting up Google Tag Manager (GTM)

All Google Tag Manager settings are found in System > Control Panel > Marketing > Google Tag Manager.

Notion image
 
  • Google tag manager code Place your GTM code here
  • Custom script source Place any other custom scripts here
  • Load Tag Manager always ”Yes” will load GTM directly, even when no consent has been given. More information below.
  • Legacy datalayer When active, it uses an older version. Not suited for newer implementations.
  • Hashed visitor email This is used for ad retargeting. This must be clearly explained in your cookie banner and will only come into effect if "all" consent is given when our cookie banner is used. When using a third party cookie banner, this data is always passed, as consent is handled elsewhere.
  • Hashed full details This allows Google to create more complete user profiles. This must be clearly explained in your cookie banner and will only come into effect if "all" consent is given when our cookie banner is used. When using a third party cookie banner, this data is always passed, as consent is handled elsewhere.

Loading GTM

For Cookie consent levels 3 and 4 we always load the Google Tag Manager. The two levels can be differentiated in Tag Manager by using the Data Layer (version 2) variable "cookieConsent". It will have the value of either "limited" or "all".

🚧
Take note! The setting to "Load Tag Manager always" in Control panel > Google Tag Manager enables the GTM, regardless of Cookie consent option. Use caution if you enable this option, and ensure only functional tags will be activated until further consent is given. In this case, the GTM is loaded even before a visitor has interacted with the cookie banner, and the default Google consent tag settings are available in GTM, assuming you installed the Peppered GTM consent template. (more information about how to set up Google consent levels using the Peppered cookie banner and Peppered GTM consent template). After visitor interaction with the cookie banner, these Google consent tag setting will be updated immediately. Make sure all your third party tags are linked to the proper Google consent tags so they will fire directly when the proper consent level is given. If your GA tag is not set up to react to changing Google consent tags, you might lose some referral data. If you find you lack referral data, you might not have set-up your GA tag triggers correctly. In that case we advice to switch the “load tag manager always” setting in the control panel off. This ensures GTM is only loaded in consent levels 3 & 4 with the correct consent level already set to measure referrals.

Using triggers

If you want to add tags that require consent for "all" cookies, e.g. if you want to re-target, you will need to split your tags by trigger.

First, set up the variable by adding a new user-defined variable (type "data layer variable", name "cookie_consent", version "Version 2").

You can set a default value here to "limited" (since GTM does not work at all unless the consent level is "limited").

In Triggers, you will have to set up (at least) two triggers:

  1. Page Views with limited cookies
  1. Page Views with all cookies

The first (limited) can be used for all tags where the visitor remains anonymous. In most cases, basic Google Analytics and E-commerce tracking should fit this level of consent.

The second trigger can be used for all tags that go further than that, like Google Adwords.

⚠️
Take note! Third party tags like chat plugins usually do extensive tracking and profiling of visitors and should only be loaded when consent is given to "all" cookies.

Related articles

 
 
Did this answer your question?
😞
😐
🤩