Configure cookie consent through GTM
When you're looking to activate external trackers & scripts in your Maglr publications, a cookie consent is often required. Through Google Tag Manager you can 'listen' and activate Tags based on this consent status. Additionally you can use Maglr's default cookie consent, or use third-party consent managers to add your own custom cookie consent to Maglr.
The live status of the cookie consent is pushed to the DataLayer. With variables, triggers, and tags, you can activate scripts whenever your visitors accept the cookie consent (or when they had already accepted it during a previous visit).
In Google Tag Manager, create a 'Data layer variable' with the name ‘maglrCookieConsented’. This variable can contain the value ‘true’ of ‘false’.
Next, add the 'Custom event' trigger and name it 'maglrConsentChanged'. Activate this trigger on 'some custom events', when 'maglrCookieConsented' equals 'true'. Whenever the page is loaded (and the consent has previously been accepted), or whenever your visitor accepts the cookie consent, the event is fired.
Now you can create Tags, such as the Google Tag, and configure it to fire whenever the 'maglrCookieConsented' custom event is triggered.
It's also possible to connect third-party applications, such as Cookiebot or CookieFirst, through Google Tag Manager. This adds your very own custom cookie consent in your Maglr publications, allowing you to maintain full control over the consent status.
If you would like to place your custom cookie consent in your Maglr publications, please contact us via info@maglr.com
Listening to the Cookie Consent with Google Tag Manager
The live status of the cookie consent is pushed to the DataLayer. With variables, triggers, and tags, you can activate scripts whenever your visitors accept the cookie consent (or when they had already accepted it during a previous visit).
Create a variable
In Google Tag Manager, create a 'Data layer variable' with the name ‘maglrCookieConsented’. This variable can contain the value ‘true’ of ‘false’.
Setting up a trigger
Next, add the 'Custom event' trigger and name it 'maglrConsentChanged'. Activate this trigger on 'some custom events', when 'maglrCookieConsented' equals 'true'. Whenever the page is loaded (and the consent has previously been accepted), or whenever your visitor accepts the cookie consent, the event is fired.
Adding the trigger to a tag
Now you can create Tags, such as the Google Tag, and configure it to fire whenever the 'maglrCookieConsented' custom event is triggered.
Controlling consent through third-party applications
It's also possible to connect third-party applications, such as Cookiebot or CookieFirst, through Google Tag Manager. This adds your very own custom cookie consent in your Maglr publications, allowing you to maintain full control over the consent status.
If you would like to place your custom cookie consent in your Maglr publications, please contact us via info@maglr.com
Updated on: 04/12/2023