Tealium consent register
This article provides an overview of Tealium consent register.
Tealium consent register is used by Tealium iQ Consent Integrations and Consent Manager to expose consent signals across your website code. It also gives the Google consent mode tag direct access to those signals, enabling appropriate reactions.
Key features
- Universal consent events: The latest Consent Manager (from
cmGeneral
template v3.1.0) and Consent Integrations (from framework template v1.2.0) use the consent register to emit events when consent settings are loaded or updated. These changes are accessible globally on the page in thewindow.tealiumConsentRegister
object. For more information, see MDN Web Docs: Introduction to events. - Support for all consent signals: Emits and retains both
implicit
andexplicit
consent signals. - Event listening: Any tag or script on the page can listen for
consent_loaded
andconsent_changed
events. This enables responsive actions based on consent status changes. For more information, see MDN Web Docs: EventTarget addEventListener() method. - Solid foundation for expansion: Tealium consent register introduces a robust new system that offers advanced customers significant customization options and will streamline the addition of new features in the future.
How it works
Tealium consent register improves consent management by allowing consent decisions to be shared across your website’s code. This allows functionalities like Google consent mode to access these decisions for appropriate actions. It acts as a standardization layer for consent signals, and makes those standardized consent signals easily available on your webpage.
Google consent mode
For essential background and context, see Google consent mode. It’s important to consult with your leadership and legal team regarding the appropriate timing and method for integrating Google tags into your page.
Prerequisites
- Deactivate any existing consent mode features from your CMP to prevent conflicts.
- Update to the latest version of either the Consent Integrations framework or the Consent Manager
cmGeneral
template, based on your use case. - Add a JavaScript extension for consent mode mappings. For details, see consent purpose mapping.
- Install the Google consent mode tag. No additional mappings are required when using the variable names from the consent purpose mapping extension.
- Categorize the consent mode tag (and all related Google tags) appropriately. Ensure that they are always allowed to fire if you’re implementing advanced consent mode, or only allowed to fire with appropriate consent, depending on the approach your organization is taking.
Advanced use cases
Access consent decisions
The window.tealiumConsentRegister.currentDecision
object enables direct access to the current consent decision on the webpage. This streamlines the implementation of custom actions such as:
- Sending opt-out events to vendors to enable removal from audiences and complete downstream deactivation.
- Adding an extra layer of consent logging on top of what your CMP offers using a Tealium iQ extension.
- Tracking consent changes, enabling access to the current decision through a JavaScript API call.
For Consent Integrations and Consent Manager, the purpose IDs in the array will be different for each specific configuration.
// get the current decision
var currentDecision = window.tealiumConsentRegister.currentDecision
// get all decisions registered since the current page loaded
var allDecisionsOnThisPage = window.tealiumConsentRegister.decisions
Consent Integrations example using OneTrust
In this example, we start in the opt-in model (implicit decision), then opt in and opt out for illustration.
Monitor consent changes
The consent register emits events when implicit
or explicit
consent signals are first detected on the page, when the consent decision is updated.
// Set example event listeners to surface consent changes
// Can be implemented to run once per page code - You an use Pre Loader or DOM Ready, depending on the use case
window.addEventListener('consent_loaded', (event) => {
console.log('Consent loaded:', event.detail.decision);
});
window.addEventListener('consent_updated', (event) => {
console.log('Consent updated:', event.detail.decision);
});
Consent Manager example of a European user opting in on initial landing
For transparency, these decisions always includes an always_on
category, since omitted
tags are always allowed.
Consent events and listeners flow diagram
A simplified overview of the flows to illustrate the new events and listeners.
Suppress Tealium consent register
You can suppress the consent register by setting the suppressConsentRegister
flag in a Pre Loader extension.
To suppress the consent register, add the following code in a Pre Loader-scoped JavaScript Code Extension:
window.tealiumCmpIntegration = window.tealiumCmpIntegration || {};
window.tealiumCmpIntegration.suppressConsentRegister = true;
Use this setting cautiously, as it will suppress all consent register functionalities.
This page was last updated: November 22, 2024