Skip to content

Commit

Permalink
Set SameSite attribute for gtag
Browse files Browse the repository at this point in the history
    Cookie “_ga” does not have a proper “SameSite” attribute value.
    Soon, cookies without the “SameSite” attribute or with an invalid
    value will be treated as “Lax”. This means that the cookie will no
    longer be sent in third-party contexts. If your application depends
    on this cookie being available in such contexts, please add the
    “SameSite=None“ attribute to it. To know more about the “SameSite“
    attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite
  • Loading branch information
dtolnay committed Jun 20, 2023
1 parent fc603fd commit 8d5ca54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion book/theme/head.hbs
Expand Up @@ -3,5 +3,5 @@
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-DG41MK6DDN', {'anonymize_ip': true});
gtag('config', 'G-DG41MK6DDN', {anonymize_ip: true, cookie_domain: 'cxx.rs', cookie_flags: 'samesite=strict;secure'});
</script>

0 comments on commit 8d5ca54

Please sign in to comment.