Hi,
I entered the JS code for Google Analytics in order to allow visitors to accept or refuse this cookie. The cookie is blocked as expected, but the problem is that even after accepting the cookie the JS code doesn’t run and I’m not able to track users
This is the JS code I used (I just put XXXX insted of the real ID) from Google Administration page.
<!– Global site tag (gtag.js) – Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-1″></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘UA-XXXXXX-1’);
</script>
Any idea will be much appreciated. I really don’t understand why the code doesn’t run.
Best,
Patrice