New cookie_flags setting in Google Analytics #3348
peacekeeper0
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Please consider adding a "cookie_settings" field to "_config.yml" below the "tracking_id" which would populate the cookie_flags parameter to gtag.js via a similar update to google-gtag.html. Without this set a default value is used resulting in a warning and analytics likely not working correctly. See example below.
_config.yml:
cookie_settings: "SameSite=None;Secure"
google-gtag.html:
gtag('config', '{{ site.analytics.google.tracking_id }}', { 'cookie_flags': '{{ site.analytics.google.cookie_settings }}'}, { 'anonymize_ip': {{ site.analytics.google.anonymize_ip | default: false }}});
Beta Was this translation helpful? Give feedback.
All reactions