Learn more about how to Set up your consent banner with a consent management platform or a content management system.
Step 1 of 2: Set up a consent banner
Configure the Google Consent Mode settings within the Mandatly system to align with consent preferences and ensure proper data handling.
- Create your Mandatly account.
- Configure your banner using the “Add Website” wizard.
- Make sure your banner complies with the requirements in the Google EU User Consent Policy (EUUCP).
Learn more about Mandatly banner setup.
Step 2 of 2: Set up consent mode
Set up using Google Tag Manager
- Open Google Tag Manager, and navigate to your container.
- In “Tags”, select New and name the tag.
- Select Tag Configuration > Discover more tag types in the Community Template Gallery.
- From the gallery, search for “Mandatly”, then install “Mandatly CMP” by mandatly-inc.
- Make sure the “Enable Google Consent Mode” toggle is ON. Learn more About Google Consent Mode.
- Copy your website GUID from Mandatly CMP account and paste it in website guid field. Learn more about How to get website guid from Mandatly account.
- Depending on your specific requirements, set the Default Consent Settings regionally or globally.
- Configure the Other Settings such as Wait for update (milliseconds), Pass ad click information through URLs (url_passthrough), and Redact ads data (ads_data_redaction).
- Select Add > Triggering.
- Select Consent Initialization - All Pages.
- Select Save.
- Test your container by selecting Preview in the top right corner.
- Publish your container.
Set up using other platforms or directly editing website code
- Login to your Mandatly account, then go to Cookie Compliance > Websites.
- Select Domain URL from the list.
- Navigate to the “Integration” tab, copy the code snippet.
- Paste the code snippet into the
<head>
tag of each page.- If you use a website builder, review the integration documentation to find out how to implement code in the
<head>
tag of each page.
- If you use a website builder, review the integration documentation to find out how to implement code in the
- In the
<head>
tag of each page, paste the following code before your CMP code snippet.
<script>
// Define dataLayer and the gtag function.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Set default consent for specific regions according to your requirements
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'functionality_storage': 'denied',
'personalization_storage': 'denied',
'security_storage': 'granted',
'regions':[<list of ISO 3166-2 region codes>]
});
// Set default consent for all other regions according to your requirements
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'functionality_storage': 'denied',
'personalization_storage': 'denied',
'security_storage': 'granted',
});
</script>
<!-- PASTE YOUR Mandatly CMP CODE SNIPPET HERE -- >
About Google Consent Mode
Turning on “Execute Google Tags Before Consent” activates Advanced Consent Mode. This allows default consent tags to fire as soon as your website loads.
If you turn this option off, Basic mode will be used. In Basic Mode, default consent tags won’t fire until a user interacts with your consent banner. To be compliant with Google Consent Mode (GCM) while using Basic Mode, you need to block third-party cookies by mapping them with the Mandatly custom events using Google Tag Manager.
Learn more about Blocking third-party cookies via GTM.
How to test using Tag Assistant
Learn more about how to Troubleshoot consent mode with Tag Assistant.