Skip to main content

Conditioning Your GTM Tags on Consent: Introduction

Written by Alexandre Dias Da Silva

This article is part of the Cookie Blocking series.

Before following the guide below, please make sure you are familiar with the general overview article Managing Consent Conditioning Logic.

If you have never installed a CMP on your site before, there is a good chance that your GTM tags are firing without taking into account the consent status. However, as we explained previously, to make your tags compliant with GDPR, you must ensure that they only fire if consent has been given. The purpose of this article is to guide you through the configuration to enable you to block/unblock your tags based on the consent status.

Before configuring the triggers, it is essential to take a moment to analyze the current functioning of your tags in Google Tag Manager. If you have never installed a CMP on your site, there is a strong chance that your tags are currently firing without any consent logic. In other words: all tags fire as soon as possible, without any consent verification.

To adapt your tags to GDPR requirements, it is important to understand their current firing logic:

  • Do they fire on all pages, upon arrival on the site (for example: Google Analytics, marketing pixels, etc.)?

  • Or only in specific cases, such as on a click, purchase, or other specific event (form submitted, scroll, button click, etc.)?

This distinction is key, as it determines the method you will need to use to integrate consent management:

  • Tags that fire globally (on "All Pages") must be blocked until explicit consent is obtained.

  • Tags that already rely on specific triggers can integrate an additional condition to verify that the service has been accepted before executing them.

How to condition your tags to consent?

To integrate consent management, you will use the events and variables that Axeptio sends to GTM.

For a tag that should fire on all pages

You will configure the tag so that it fires ONLY ONCE the "go-ahead" is given by Axeptio (via the event of the form axeptio_activate_).

For a tag that should fire only when a specific event occurs

You will configure the tag so that it fires when the event occurs UNLESS consent has not been obtained (that is, if the service in question is not in the list of consented services, accessible via the Axeptio variable).

In GTM, this logic can be expressed in several valid ways. In the rest of this article series, we will use the most direct method applicable to the vast majority of GTM configurations. However, if you have specific needs, please refer to our article How Axeptio communicates with GTM: events and variables to explore other approaches.

Did this answer your question?