BigID is already a Google-certified CMP and you can implement Google Consent Mode V2
As a Google-certified CMP, you can integrate BigID directly from Google Tag Manager and in this way integrate Google Consent Mode V2 as well. To know more about what is Google Consent mode V2, check out our latest blog.
Set up Google Consent Mode V2 using GTM (recommended)
When you implement BigID through Google Tag Manager, it is already integrated automatically with Google Consent Mode V2. You can do it, and no technical experience is needed at all.
Manual setup (if you can’t use GTM)
If you are integrating the Consent Banner by copying and pasting the script tag directly in the HTML code, you need to add a second code snippet to comply with Google's consent requirements. In other words, KEEP the banner script tag and ADD the following one.
1. Add the following <script>
tag to the <head>
of your pages:
Important
Remember to replace
<your-site-id>
with your actual Site ID shown in the platform.
For Explicit consent banners:
<script>
(function(siteId, win, doc) {
var cookieName = 'bigid-consent-' + siteId;
var cookies = doc.cookie.split(';');
var cookie = cookies.map((c) => c.split('=')).find(([name]) => name.trim() === cookieName);
var consentStr = cookie ? cookie.slice(1).join('=').trim() : undefined;
var consent = {};
consentStr?.split('|').map((v) => v.split('=')).forEach(([k, v]) => {
consent[k] = v === 'true';
});
// Initialize the data layer for Google Tag Manager (this should mandatorily be done before the Privacy Controls and Cookie Soluion is loaded)
win.dataLayer = win.dataLayer || [];
function gtag() {
win.dataLayer.push(arguments);
}
win.gtag = win.gtag || gtag;
win.gtag("consent", "default", {
ad_storage: consent.marketing ? 'granted' : 'denied',
analytics_storage: consent.preferences ? 'granted' : 'denied',
functionality_storage: consent.preferences ? 'granted' : 'denied',
personalization_storage: consent.preferences ? 'granted' : 'denied',
security_storage: consent.preferences ? 'granted' : 'denied',
ad_user_data: consent.marketing ? 'granted' : 'denied',
ad_personalization: consent.marketing ? 'granted' : 'denied',
});
window.gtag('set', {
'ads_data_redaction': !consent.marketing,
'url_passthrough': !consent.marketing || !consent.preferences,
});
})("your-site-id", window, document);
</script>
For Implicit consent banners:
<script>
(function(siteId, win, doc) {
var cookieName = 'bigid-consent-' + siteId;
var cookies = doc.cookie.split(';');
var cookie = cookies.map((c) => c.split('=')).find(([name]) => name.trim() === cookieName);
var consentStr = cookie ? cookie.slice(1).join('=').trim() : undefined;
var consent = {};
consentStr?.split('|').map((v) => v.split('=')).forEach(([k, v]) => {
consent[k] = v === 'true';
});
// Initialize the data layer for Google Tag Manager (this should mandatorily be done before the Privacy Controls and Cookie Soluion is loaded)
win.dataLayer = win.dataLayer || [];
function gtag() {
win.dataLayer.push(arguments);
}
win.gtag = win.gtag || gtag;
win.gtag("consent", "default", {
ad_storage: consent.optedIn !== false ? 'granted' : 'denied',
analytics_storage: consent.optedIn !== false ? 'granted' : 'denied',
functionality_storage: consent.optedIn !== false ? 'granted' : 'denied',
personalization_storage: consent.optedIn !== false ? 'granted' : 'denied',
security_storage: consent.optedIn !== false ? 'granted' : 'denied',
ad_user_data: consent.optedIn !== false ? 'granted' : 'denied',
ad_personalization: consent.optedIn !== false ? 'granted' : 'denied',
});
window.gtag('set', {
'ads_data_redaction': consent.optedIn === false,
'url_passthrough': consent.optedIn === false,
});
})("your-site-id", window, document);
</script>
Find attached the minified versions of the code for the different types of banners.
To learn more about Consent Mode, take a look at the official blog of the Google Marketing Platform, the Google Analytics Help, the official Set up consent mode on websites of Google and the gtag.js guide.
No-code setup (if you can’t use GTM or add embedded code)
If you are integrating the Consent Banner by copying and pasting the script tag directly in the HTML code but you can not add a second block of code, you can still add a flag to the initial code snippet to comply with Google's consent requirements.
Change the code snippet from:
<script src="https://bigidcmp.cloud/banner.js?siteId=<your-site-id>"></script>
To:
<script src="https://bigidcmp.cloud/banner.js?siteId=<your-site-id>&includeGCMDefault=true"></script>