Cookie consent: Maglr banner, GTM, and third-party CMPs
Maglr's cookie consent tells Google Tag Manager (GTM) and your own scripts whether a visitor of your publication accepted cookies. You can collect that choice in two ways:
- Maglr's cookie consent banner: a built-in banner with an accept and a reject button, set with
Light modeorStrict mode. - Your own consent management platform (CMP): a tool such as Cookiebot, CookieFirst or OneTrust shows the banner and reports the choice to Maglr, set with
Manual mode.
Light mode, Strict mode and Manual mode are the options of the Consent mode setting. Cookie consent is set per domain, so it applies to every publication on that domain.
Turning on Maglr's cookie consent banner
To show Maglr's own cookie consent banner on the publications of a domain:
- In the dashboard, open
Settings→Domain names. - Click the pencil button next to the domain your publication is on.
- In the
Statistics & integrationsection, turn onActivate cookie consent notification. - Under
Consent mode, chooseLight modeorStrict mode. - Click
Save changes.
Only Super admins see Domain names in Settings.

The two banner modes differ in what runs before the visitor accepts:
Light mode: Maglr's privacy-friendly statistics run, and a directly connected Google Analytics runs anonymously. After the visitor accepts, YouTube and Vimeo videos can play, and a directly connected Google Analytics also runs without anonymisation, unlessActivate Google Analytics in anonymous modeis on.Strict mode: Maglr's statistics, a directly connected Google Analytics, and YouTube and Vimeo videos only run after the visitor accepts.
In both modes, the contact and registration forms in the publication's menu can only be sent after the visitor accepts, because they use reCAPTCHA.
For what each mode does in detail, see Configure cookie consent.
Firing GTM tags on cookie consent
Maglr pushes the visitor's cookie consent choice to the GTM dataLayer, so you can fire GTM tags only when a visitor accepts cookies, or when they accepted during a previous visit. This needs two settings in the domain's Statistics & integration section:
- Google Tag Manager is connected:
Google Analytics or GTMis on,Integration typeisGoogle Tag Manager, and yourGTM codeis filled in. Activate cookie consent notificationis on, in anyConsent mode. Without cookie consent turned on, Maglr doesn't push the consent event.
Maglr always loads your GTM container, whatever the visitor chose and in every Consent mode, including Strict mode. Maglr doesn't block GTM tags. Each GTM tag that needs consent must use the consent trigger described in Creating the consent trigger in GTM.
The maglrConsentChanged data layer event
When the visitor's cookie consent choice is known, Maglr pushes a custom event to the GTM data layer:
Key | Value |
|---|---|
|
|
|
|
Maglr pushes this event when:
- A visitor accepts or rejects cookies.
- A returning visitor loads the page and a choice was already saved in Maglr's
MaglrCookieConsentcookie.
It does not fire on a first visit before the visitor has made a choice.
maglrPageView), the same value is available under MaglrCookieConsented, with a capital M. For the GTM setup in this article, use maglrCookieConsented on the maglrConsentChanged event.Creating the consent variable in GTM
The consent variable reads the visitor's choice (true or false) from Maglr's maglrConsentChanged data layer event. To create it in Google Tag Manager:
- Go to
Variables. - Under
User-Defined Variables, clickNew. - Click
Variable Configurationand chooseData Layer Variable. - In
Data Layer Variable Name, entermaglrCookieConsented.

- Name the variable
maglrCookieConsented. - Click
Save.
The variable now contains true or false.
Creating the consent trigger in GTM
The consent trigger fires on Maglr's maglrConsentChanged data layer event when the visitor accepted cookies. It uses the maglrCookieConsented variable (see Creating the consent variable in GTM). To create it in Google Tag Manager:
- Go to
Triggersand clickNew. - Click
Trigger Configurationand chooseCustom Event. - In
Event name, entermaglrConsentChanged. - Under
This trigger fires on, chooseSome Custom Events. - Set the condition to
maglrCookieConsentedequalstrue. - Name the trigger
maglrConsentChanged. - Click
Save.

This trigger fires when a visitor accepts cookies, or when a returning visitor already accepted during a previous visit.
Firing a tag on consent
To make a GTM tag (such as the Google Tag) run only after a visitor accepts cookies, attach the maglrConsentChanged consent trigger to it in Google Tag Manager:
- Open the tag.
- Click
Triggering. - Choose the
maglrConsentChangedtrigger.

- Remove any other firing trigger from the tag, such as
All PagesorInitialization - All Pages. Otherwise the tag also fires without consent. - Click
Save. - Click
Submitto publish your GTM container. The change takes effect on your publication only after you publish the container.
Choose the maglrConsentChanged trigger, and don't use maglrCookieConsented as an event name. maglrCookieConsented is the data layer variable, not the event, so a trigger with that event name never fires.
Using your own consent management platform (CMP)
You can use your own consent management platform (CMP), such as Cookiebot, CookieFirst or OneTrust, instead of Maglr's cookie consent banner. With Manual mode, Maglr doesn't show its own banner. Your CMP shows the consent banner; Maglr only receives the visitor's choice.
Your CMP and Maglr communicate through these events and this function:
Direction | Event / API | Purpose |
|---|---|---|
Your CMP → Maglr |
| Report the visitor's choice ( |
Your CMP → Maglr |
| Report the visitor's choice through a global function, including a withdrawal after an accept |
Maglr → your CMP |
| Maglr asks your CMP to show its banner again, when a visitor clicks a YouTube or Vimeo video or opens the contact or registration form in the publication's menu (these forms use reCAPTCHA) |
Maglr → GTM |
| The same request, pushed to the GTM data layer as an event |
In Manual mode, Maglr holds back its own statistics until the visitor accepts, but it doesn't hold back a directly connected Google Analytics. Connect Google Analytics through Google Tag Manager instead, and fire it on your CMP's consent.
Turning on Manual mode
Manual mode hides Maglr's cookie consent banner, so your own CMP can collect the visitor's choice. To turn it on:
- In the dashboard, open
Settings→Domain names. - Click the pencil button next to the domain your publication is on.
- In the
Statistics & integrationsection, turn onActivate cookie consent notification. - Under
Consent mode, chooseManual mode. - Click
Save changes.
Only Super admins see Domain names in Settings.
Reporting the visitor's choice to Maglr
In Manual mode, your CMP reports the visitor's cookie consent choice to Maglr with the MaglrCustomCookieConsent event or the window.setMaglrConsent function:
- First choice: send the
MaglrCustomCookieConsentevent, or callwindow.setMaglrConsent(true)orwindow.setMaglrConsent(false). - Withdrawal after an accept, on the same page visit: call
window.setMaglrConsent(false). After a visitor accepts, Maglr stops listening to theMaglrCustomCookieConsentevent, so aconsented: falseevent sent after an accept is ignored. - Before calling the function: check that it exists with
if (window.setMaglrConsent).
Maglr saves the visitor's choice in its own MaglrCookieConsent cookie for 365 days. When a page loads with this cookie set, Maglr uses the saved choice. At that point it doesn't listen to the MaglrCustomCookieConsent event and doesn't define window.setMaglrConsent. On such a page, a choice your CMP reports, including a withdrawal, doesn't reach Maglr until Maglr asks for consent on that page (see Showing your banner when Maglr asks for consent). Calling window.setMaglrConsent before then, without the check, causes a JavaScript error.
<script>
// First choice: accept
document.dispatchEvent(new CustomEvent("MaglrCustomCookieConsent", {
detail: { consented: true }
}));
// First choice: reject
document.dispatchEvent(new CustomEvent("MaglrCustomCookieConsent", {
detail: { consented: false }
}));
// Withdrawal after an accept: use the global function
if (window.setMaglrConsent) {
window.setMaglrConsent(false);
}
</script>
Showing your banner when Maglr asks for consent
In Manual mode, Maglr asks your CMP to show its consent banner again when a visitor who hasn't accepted cookies clicks a YouTube or Vimeo video, or opens the contact or registration form in the publication's menu (these forms use reCAPTCHA and can't be sent until the visitor accepts). Maglr then dispatches the MaglrRequestShowCookieConsent event on document. To open your CMP's banner, listen for it:
document.addEventListener("MaglrRequestShowCookieConsent", function () {
// open your CMP's consent banner here
});
At the same moment, Maglr pushes {event: "maglrConsentRequested"} to the GTM data layer. If your CMP runs through Google Tag Manager, you can use a Custom Event trigger on maglrConsentRequested instead.
If the visitor arrived with a choice already saved in Maglr's MaglrCookieConsent cookie, the first such click or form opening on that page doesn't dispatch MaglrRequestShowCookieConsent. It makes Maglr start listening to the MaglrCustomCookieConsent event and define window.setMaglrConsent, so your CMP can report the choice from then on. Maglr dispatches MaglrRequestShowCookieConsent from the next request on that page.
Frequently asked questions
Does Maglr block my Google Tag Manager tags until a visitor accepts cookies?
No. Maglr always loads your Google Tag Manager container, whatever the visitor chose and in every Consent mode, including Strict mode. To run a tag only after consent, fire it on a Custom Event trigger for Maglr's maglrConsentChanged event with the condition maglrCookieConsented equals true.
How long does Maglr remember a visitor's cookie consent choice?
Maglr remembers the choice for 365 days. It saves the choice in the MaglrCookieConsent cookie on the publication's domain and uses it on the visitor's later visits.
Can I use Maglr's cookie consent banner and my own CMP at the same time?
No. Consent mode is one setting per domain: Light mode and Strict mode show Maglr's cookie consent banner, and Manual mode hides it so your own consent management platform (CMP) can collect the choice.
Updated on: 19/10/2026