Depending on how your website is built and what scripts your website uses, sometimes manually code needs to be added to third party scripts in order to control them properly.
After implementing and testing the Usercentrics consent solution on your website, if you notice that Google Analytics 4 related cookies (such as "_GA") are still being loaded on users' browsers, you can add additional code to the Google Analytics 4 script to ensure Usercentrics can properly control it.
You need to add the following into the Google Analytics 4 script:
type="text/plain" data-usercentrics="Google Analytics 4"
So if your Google Analytics 4 script looks like this:
<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-L0BHKZ7CP4"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXXXXXXXX'); </script>
You would update it to this:
<!-- Google tag (gtag.js) --> <script type="text/plain" data-usercentrics="Google Analytics 4" async src="https://www.googletagmanager.com/gtag/js?id=G-L0BHKZ7CP4"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXXXXXXX'); </script>
Then clear cache and test the website. You should see GA related cookies no longer load until after a user gives consent.
Still firing?
Visit the final page of the Cookie Policy and Consent Tool questionnaire and make sure you have the Service "Google Analytics 4" listed (not "Google Analytics"). If you have "Google Analytics" listed, be sure to remove that Service and click 'add new service' to add in Google Analytics 4.