1// Google Analytics (gtag.js) bootstrap + consent handling. 2// Externalized from app.html so it is served from 'self' and satisfies the 3// nonce-based script-src CSP (inline scripts in app.html are not nonced by SvelteKit). 4window.dataLayer = window.dataLayer || []; 5function gtag() { 6 window.dataLayer.push(arguments); 7} 8gtag('js', new Date()); 9gtag('config', 'G-S4SJ5JWG5Q'); 10 11window.addEventListener('cc:onConsent', ({ detail }) => { 12 var analyticsGranted = detail.cookie.categories.includes('analytics'); 13 var coreGranted = detail.cookie.categories.includes('necessary'); 14 15 gtag('consent', 'update', { 16 ad_storage: analyticsGranted ? 'granted' : 'denied', 17 analytics_storage: analyticsGranted ? 'granted' : 'denied', 18 personalization_storage: analyticsGranted ? 'granted' : 'denied', 19 functionality_storage: coreGranted ? 'granted' : 'denied', 20 security_storage: coreGranted ? 'granted' : 'denied', 21 ad_user_data: analyticsGranted ? 'granted' : 'denied', 22 ad_personalization: analyticsGranted ? 'granted' : 'denied' 23 }); 24});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.