I am trying to ensure my client site is GDPR compliant, and have used the amazing Finsweet Cookie Consent tool (shout out to @Finsweet for making such a useful tool for the community).
The issue I’m running into, is that the google analytics script still appears to be loading prior to the user opting in. I have fully followed to Finsweet set up but when I load the site in my browser, my network monitor still registers analytics.google.com, and same with the duckduckgo browser extension I’m using to check what requests are coming through.
Here’s my read only link: read only
Note: I’ve just updated the header code for google analytics to reflect the move from Universal Analytics to GA4, but I don’t know if this has had any influence on this issue.
Here is the GA code I’m using modified to Finsweet’s specifications:
<!-- Google Analytics 4 -->
<script async="" src="https://www.googletagmanager.com/gtag/js?id=G-idnumber" type="fs-cc" fs-cc-categories="analytics"></script>
<script type="fs-cc" fs-cc-categories="analytics">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-idnumber');
</script>
<!-- Finsweet Cookie Consent -->
<script async src="https://cdn.jsdelivr.net/npm/@finsweet/cookie-consent@1/fs-cc.js" fs-cc-mode="opt-in"></script>
Can any kind person help me troubleshoot what’s going on??