-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix gtag cookie settings #15
Conversation
✅ Deploy Preview for cone-development-site ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@iamgergo Please open your console and see before + after on https://cone-development-site.netlify.app/ |
@@ -17,5 +17,8 @@ if (getCookie('cone-cookie-law-analytics') === 'accepted') { | |||
window.dataLayer = window.dataLayer || []; | |||
|
|||
gtag('js', new Date()); | |||
gtag('config', coneGtagId); | |||
gtag('config', coneGtagId, { | |||
'cookie_domain': window.location.hostname, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be document.location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Others mention that is should not be added in config
but in a separate gtag('set', { ... });
before config
.
Thanks I will test it! |
Firefox and maybe other browsers warn about non-samesite cookies on the browser console.
https://developers.google.com/analytics/devguides/collection/ga4/reference/config#cookie_flags