From 911b5b4981436d5ef3c0cf5031afe8084017194a Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Fri, 15 Mar 2024 16:43:59 -0600 Subject: [PATCH] Re-enabling Google Analytics EEA cookie prevention, see https://github.com/phetsims/phetcommon/issues/64, https://github.com/phetsims/website/issues/1190 --- js/analytics/google-analytics.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/analytics/google-analytics.js b/js/analytics/google-analytics.js index c48efbb..1ffeafd 100644 --- a/js/analytics/google-analytics.js +++ b/js/analytics/google-analytics.js @@ -106,6 +106,12 @@ ad_storage: 'denied', analytics_storage: 'granted' } ); + // EEA analytics storage denied for cookies, see https://github.com/phetsims/website/issues/1190 + gtag( 'consent', 'default', { + ad_storage: 'denied', + analytics_storage: 'denied', + region: [ 'BE', 'BG', 'CZ', 'DK', 'CY', 'LV', 'LT', 'LU', 'ES', 'FR', 'HR', 'IT', 'PL', 'PT', 'RO', 'SI', 'HU', 'MT', 'NL', 'AT', 'IS', 'LI', 'NO', 'SK', 'FI', 'SE', 'DE', 'EE', 'IE', 'EL' ] + } ); gtag( 'config', phet.chipper.queryParameters.ga4 ); // Dynamically load the script @@ -128,6 +134,12 @@ ad_storage: 'denied', analytics_storage: 'granted' } ); + // EEA analytics storage denied for cookies, see https://github.com/phetsims/website/issues/1190 + gtmTag( 'consent', 'default', { + ad_storage: 'denied', + analytics_storage: 'denied', + region: [ 'BE', 'BG', 'CZ', 'DK', 'CY', 'LV', 'LT', 'LU', 'ES', 'FR', 'HR', 'IT', 'PL', 'PT', 'RO', 'SI', 'HU', 'MT', 'NL', 'AT', 'IS', 'LI', 'NO', 'SK', 'FI', 'SE', 'DE', 'EE', 'IE', 'EL' ] + } ); window.dataLayer.push( { simBrand: phet.chipper.brand, simName: phet.chipper.project,