Jump to content

Google Analytics 4 consent not detected

Recommended Posts

Posted

 

 
 
 
 
306 / 5.000
 
Hi, I have a problem that I can't solve. I connected my website to Google Analytics 4, I activated the cookie banner and injected the code indicated by google
 

<script>

// Define dataLayer and the gtag function.

window.dataLayer = window.dataLayer || [];

function gtag(){dataLayer.push(arguments);}

 

// Set default consent for specific regions according to your requirements

gtag('consent', 'default', {

  'ad_storage': 'denied',

  'ad_user_data': 'denied',

  'ad_personalization': 'denied',

  'analytics_storage': 'denied',

 'regions':[<list of ISO 3166-2 region codes>]

});

// Set default consent for all other regions according to your requirements

gtag('consent', 'default', {

  'ad_storage': 'denied',

  'ad_user_data': 'denied',

  'ad_personalization': 'denied',

  'analytics_storage': 'denied'

});

 

</script>

<!--Banner script here!-->

 
 
but despite this it results in undetected consent indicators. Can anyone tell me where the error is. I attach a link where you can see the problem. Thanks
 

Screenshot 2024-10-07 alle 17.17.26.png

  • Replies 0
  • Views 394
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Posted Images

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.