Hi @wal99,
Please read our article on consent mode here:
https://complianz.io/consent-mode/
An example implementation which you could do yourself should look something like this:
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'security_storage': "granted",
'functionality_storage': "granted",
'personalization_storage': "denied",
'analytics_storage': 'denied',
'ad_storage': "denied",
});
document.addEventListener("cmplz_cookie_warning_loaded", function (e) {
gtag('js', new Date());
gtag('config', 'G_code');
});
document.addEventListener("cmplz_fire_categories", function (e) {
var consentedCategories = e.detail.categories;
if (cmplz_in_array( 'marketing', consentedCategories )) {
gtag('consent', 'update', {
'security_storage': "granted",
'functionality_storage': "granted",
'personalization_storage':"granted",
'analytics_storage':"granted",
'ad_storage':"granted",
});
}
});