Skip to content
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

Merged
merged 2 commits into from
Aug 29, 2023
Merged

Fix gtag cookie settings #15

merged 2 commits into from
Aug 29, 2023

Conversation

szepeviktor
Copy link
Contributor

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

@netlify
Copy link

netlify bot commented Aug 28, 2023

Deploy Preview for cone-development-site ready!

Name Link
🔨 Latest commit 8f6d620
🔍 Latest deploy log https://app.netlify.com/sites/cone-development-site/deploys/64eca478cffdbe00081b5f49
😎 Deploy Preview https://deploy-preview-15--cone-development-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Aug 28, 2023

@iamgergo Please open your console and see before + after on https://cone-development-site.netlify.app/
Deploy Previews have too much mess!

@@ -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,
Copy link
Contributor Author

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

Copy link
Contributor Author

@szepeviktor szepeviktor Aug 28, 2023

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.

@adamlaki adamlaki merged commit 573bd0d into conedevelopment:main Aug 29, 2023
5 checks passed
@adamlaki
Copy link
Member

Thanks I will test it!

@szepeviktor szepeviktor deleted the patch-1 branch August 29, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants