-
Notifications
You must be signed in to change notification settings - Fork 5
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
(Sims) prevent cookie save before consent #61
Comments
Testing link for latest patch here: https://bayes.colorado.edu/dev/olsonjb/cookietest1.html |
Patch: Subject: [PATCH] Removing cookies?
---
Index: js/analytics/google-analytics.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/analytics/google-analytics.js b/js/analytics/google-analytics.js
--- a/js/analytics/google-analytics.js (revision ca3844837dac4ee86a18d43ea27b2cfb7bd3fcf5)
+++ b/js/analytics/google-analytics.js (date 1674850208789)
@@ -145,6 +145,10 @@
function gtag() { ga4DataLayer.push( arguments ); } // eslint-disable-line no-inner-declarations,no-undef,prefer-rest-params
gtag( 'js', new Date() );
+ gtag( 'consent', 'default', {
+ ad_storage: 'denied',
+ analytics_storage: 'denied'
+ } );
gtag( 'config', phet.chipper.queryParameters.ga4 );
// Dynamically load the script
@@ -160,6 +164,13 @@
// For some reason, having dataLayer declaration here might have fixed the ability to use gtag.js and gtm.js at the
// same time. Don't move without testing.
window.dataLayer = window.dataLayer || [];
+ function gtmTag() {
+ window.dataLayer.push( arguments ); // eslint-disable-line prefer-rest-params
+ }
+ gtmTag( 'consent', 'default', {
+ ad_storage: 'denied',
+ analytics_storage: 'denied'
+ } );
window.dataLayer.push( {
simBrand: phet.chipper.brand,
simName: phet.chipper.project, |
@jonathanolson this is looking good in my testing (various combinations of external test query parameters). Should we also do a 3rd party test (host on http://jonathanolson.net)? |
@oliver-phet can you test https://jonathanolson.net/phet/cookietest1.html? |
@jonathanolson I tested various configurations, with and without query parameters. Cookies aren't being saved and all the collect calls are firing as expected! I think this version is good to go. |
@jonathanolson maybe hold off on publication - I'm doing some double checking and while I see collect calls in the console, I'm NOT seeing hits in analytics! |
@jonathanolson I'm still Googling, but it seems setting |
It seems clear that none of our data is personal data under GDPR.
However, there still seem to be countries within the EU where explicit consent to analytics cookies is required before placing our GA cookies.
|
Production deploys completed. |
Closing, tracking saving cookies/consent in https://github.com/phetsims/website/issues/1190 |
Discussed related to https://docs.google.com/document/d/1ucmlPT0W5o3-98YPA8XEr12Lg0eSF8rSaLGdfUtJZvA/edit#
Since the latest patch in #60, cookies are now being set on all tagged pages (including sims). This was inadvertent and we want disable setting cookies in sims by default.
The text was updated successfully, but these errors were encountered: