Cookie consent: Maglr banner, GTM, and third-party CMPs
Cookie consent in Maglr publications
When you're looking to activate external trackers and scripts in your Maglr publications, a cookie consent is often required. Through Google Tag Manager you can listen to consent status and activate tags based on that status.
Maglr supports two approaches:
- Maglr's default cookie consent — a built-in accept/reject banner in your publication (with a standard or strict analytics mode)
- Third-party consent managers — your own CMP (e.g. Cookiebot, CookieFirst, OneTrust) connected via Maglr's manual consent mode

Listening to cookie consent with Google Tag Manager
Maglr pushes the live consent status to the dataLayer. With variables, triggers, and tags you can activate scripts when a visitor accepts cookies — or when they already accepted during a previous visit.
How it works
When consent is known, Maglr pushes a custom event to the data layer:
Key | Value |
|---|---|
|
|
|
|
This event fires when:
- A visitor accepts or rejects cookies
- A returning visitor loads the page and a choice was already saved (cookie
MaglrCookieConsent)
It does not fire on a first visit before the visitor has made a choice.
Note: On other Maglr data layer events (such as
maglrPageView), the same value is available underMaglrCookieConsented(with a capital M). For the setup below, usemaglrCookieConsentedon themaglrConsentChangedevent.
Create a variable
In Google Tag Manager, create a Data Layer Variable:
- Variable name:
maglrCookieConsented - Data Layer Variable Name:
maglrCookieConsented
This variable contains true or false.

Set up a trigger
Add a Custom Event trigger:
- Trigger name:
maglrConsentChanged - Event name:
maglrConsentChanged - Fire on Some Custom Events
- Condition:
maglrCookieConsentedequalstrue
This trigger fires when a visitor accepts cookies, or when a returning visitor already accepted during a previous visit.

Add the trigger to a tag
Create tags (such as the Google Tag) and configure them to fire on the maglrConsentChanged custom event trigger.
Do not use maglrCookieConsented as the event name — that is the data layer variable, not the event.

Using third-party consent managers
You can use your own cookie consent manager instead of Maglr's default banner. Enable manual consent mode in your interface settings (Activate cookie consent notification → manual / third-party option).
In this mode Maglr does not show its own banner. Your CMP owns the UI; Maglr only receives the resulting choice.
Direction | Event / API | Purpose |
|---|---|---|
Your CMP → Maglr |
| Report the visitor's choice ( |
Your CMP → Maglr |
| Same as above, via a global function |
Maglr → your CMP |
| Maglr asks your CMP to show its banner again (for example when Maglr needs consent for a blocked action) |
Report consent to Maglr
Whenever your CMP knows the visitor's choice, send it to Maglr — on first choice, on page load if a choice already exists in your CMP, and again when the visitor changes or withdraws consent:
<script>
// Accept
document.dispatchEvent(new CustomEvent("MaglrCustomCookieConsent", {
detail: { consented: true }
}));
// Reject / withdraw
document.dispatchEvent(new CustomEvent("MaglrCustomCookieConsent", {
detail: { consented: false }
}));
// Or use the global function (same meaning):
// window.setMaglrConsent(true);
// window.setMaglrConsent(false);
</script>
Updated on: 08/08/2026