Google Consent Mode - Consent signals not detected
Apr 18, 2024 8:28:45 GMT 1
Post by webus on Apr 18, 2024 8:28:45 GMT 1
Hi,
Im having troubles with Google Consent Mode. Analytics is not detecting consent signals (neither Mode V1 or V2).
- Joomla 3.10.12
- PHP 7.2
- n3t Cookie consent version 4.1.5
- My own made custom template. Google TAG scripts written directly into templates index.php file.
Cant update those due to some legacy functionality, but I dont believe the problem is within outdated Joomla, its me doing something wrong.
I have read and followed FAQ. Also read Google Guide how to set it up, but I cant get it up.
Script I use to insert Google TAG, inserted right after the </head>:
<script>
// Define dataLayer and the gtag function.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Set default consent to 'denied' as a placeholder
// Determine actual values based on your own requirements
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied'
});
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GTM-PRIVATE">
</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GTM-PRIVATE');
</script>
Can it be that its blocked by n3t? I did "Scan site for cookies" inside n3t plugin, but it didint seem to catch any Google cookies. So I added names manually: ibb.co/QrTXC9K (screenshot)
I also followed FAQ and added code to Expert page as instructed: ibb.co/fMKF0SJ (screenshot)
I tried turning PageScripts On/Off (left at No)
Tried adding Google Tag scripts above
<jdoc:include type="head" />
thinking maybe they have to load first. Google collects depersonalized data, but Consent Mode doesnt work - consent signals not detected.
What am I missing?
I would really appreciate any help or guidance.
Thank you in advance.