Skip to main content

dataLayer events: use Consent Studio as a trigger for GTM Tags

Leverage our custom dataLayer events

Updated over a week ago

Trigger GTM tags based on user consent in Consent Studio

With Consent Studio, we have a whole hosts of custom events that are submitted to the window.dataLayer array when a user interacts with a consent banner and/or when they make a (new) consent decision.

These events can be used to create Custom Triggers in Google Tag Manager.

In opposite to the β€œAll Pages” trigger, or similar, this method of creating custom triggers will allow tags to be loaded without requiring a page refresh in a client-side Google Tag Manager container.

Remember: the Consent Studio CMP tag itself should have the "Consent Initialization - All Pages" trigger at all times.

Whenever a user retracts their consent, they do need to reload the page in order to de-activate the tags that were triggered under their previous consent.

Overview: compatibility events

These events are simple and are meant to be compatible with configurations that were made for other CMPs:

  • cookie_consent_update

Overview: simple events

These dataLayer events have no fluff to them and are meant for clear, simple understanding.

  • cookie_consent_granted_functional

  • cookie_consent_granted_analytics

  • cookie_consent_granted_marketing

Overview: contextual events

Button clicks (fire on click, before consent is submitted)

Event

When

consent-studio__user-interacted__btn__accept-all

User clicked "Accept all"

consent-studio__user-interacted__btn__reject-all

User clicked "Reject all"

consent-studio__user-interacted__btn__accept-selection

User clicked "Save selection"

consent-studio__user-interacted__btn__customise

User clicked "Customise" / preferences button

User interaction to open any of the modals

Event

When

consent-studio__user-interacted__open-consent-banner

User re-opened the consent banner (footer link, #consent-banner, or external event)

consent-studio__user-interacted__open-tracking-overview

User opened the tracking overview / cookie list

Consent Category toggled

Event

When

consent-studio__user-interacted__modal__toggled-analytics

User toggled the analytics checkbox

consent-studio__user-interacted__modal__toggled-marketing

User toggled the marketing checkbox

Consent State update following user interaction

Event

When

consent-studio__user-interacted__modal

User submitted consent via banner interaction

consent-studio__user-interacted__modal__granted-analytics

Analytics granted

consent-studio__user-interacted__modal__denied-analytics

Analytics denied

consent-studio__user-interacted__modal__granted-marketing

Marketing granted

consent-studio__user-interacted__modal__denied-marketing

Marketing denied

consent-studio__user-interacted__modal__granted-all

Both analytics + marketing granted

consent-studio__user-interacted__modal__denied-all

Both analytics + marketing denied

When a user submits consent via the banner, both consent-studio__user-interacted__modal__* events and consent-studio__parsed-consent__* events fire. This allows triggers configured for parsed-consent events to work both on page load (returning visitors) and immediately after user interaction, without requiring separate trigger configurations.

Parsed Consent State (fires on page load for returning visitors and following user interaction)

Event

When

consent-studio__parsed-consent

Consent loaded from existing cookie

consent-studio__parsed-consent__granted-analytics

Analytics was granted

consent-studio__parsed-consent__denied-analytics

Analytics was denied

consent-studio__parsed-consent__granted-marketing

Marketing was granted

consent-studio__parsed-consent__denied-marketing

Marketing was denied

consent-studio__parsed-consent__granted-all

Both analytics + marketing granted

consent-studio__parsed-consent__denied-all

Both analytics + marketing denied

Did this answer your question?