console.log
console.log("allow Analytics window.fn.gtag")
console.log('is gtab: ' + typeof gtag)
gtag('consent', 'update', {'analytics_storage': 'granted', 'ad_user_data': 'granted'});
console.log("deny Analytics window.fn.gtag")
console.log("is gtag" + typeof gtag)
gtag('consent', 'update', {'analytics_storage': 'denied', 'ad_user_data': 'denied'});
window['ga-disable-UA-G-XXXXXXXXX'] = true;
console.log("allow Marketing window.fn.gtag")
console.log("is gtag" + typeof gtag)
gtag('consent', 'update', {'ad_storage': 'granted', 'ad_personalization': 'granted'});
console.log("denyMarketing window.fn.gtag")
console.log("is gtag " + typeof gtag)
gtag('consent', 'update', {'ad_storage': 'denied', 'ad_personalization': 'denied'});
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'ad_storage': 'denied',
'analytics_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied'
});
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXX');
</script>
Login and write down your comment.
Login my OpenCart Account