This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| const targetScript = "gtm.js"; | |
| function fmt(ms) { return ms.toFixed(2) + "ms"; } | |
| // Poll performance entries until we find GTM.js | |
| const checkInterval = 50; // ms | |
| const maxAttempts = 100; // ~5 seconds max | |
| let attempts = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function protectDataLayer() { | |
| window._internalDataLayer = window.dataLayer || []; | |
| // Wrap the array in a Proxy to detect internal changes | |
| const dataLayerProxy = new Proxy(window._internalDataLayer, { | |
| set(target, prop, value, receiver) { | |
| console.log(`[dataLayer] Change detected: "${prop}" set to`, value); | |
| return Reflect.set(target, prop, value, receiver); | |
| }, | |
| get(target, prop, receiver) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MovementDetector { | |
| constructor(options = {}) { | |
| // Configuration with defaults | |
| this.threshold = options.threshold || 5; | |
| this.debug = options.debug || false; | |
| this.onMovementChange = options.onMovementChange || null; | |
| // State tracking | |
| this.lastRotation = { x: 0, y: 0, z: 0 }; | |
| this.isMoving = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(){ | |
| var wpo = { | |
| redirects: window.performance.navigation.redirectCount, | |
| resources: { | |
| iframe: 0, | |
| img: 0, | |
| css: 0, | |
| script: 0, | |
| beacon: 0, | |
| xmlhttprequest: 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| let ga_cid = document.cookie | |
| .split('; ') | |
| .find(row => row.startsWith('_ga=')) | |
| ?.split('=')[1]; | |
| // Listen for changes in the cookie store | |
| cookieStore.addEventListener('change', (e) => { | |
| e.changed.forEach(c => { | |
| if (c.name.startsWith('_ga')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // DV - 2022 - ES5 | |
| // Check if GA4 has been loaded | |
| var getLoadedGA4Containers = function() { | |
| return Object.keys( | |
| window.google_tag_data && | |
| window.google_tag_data.tidr && | |
| window.google_tag_data.tidr.container || {} | |
| ).filter(function(e){ return e.startsWith('G-') }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ---------------------------------------------------------------------- | |
| // Privacy Sandbox Relevance & Measurement APIs Check | |
| // ---------------------------------------------------------------------- | |
| const privacySandboxApisAvailability = { | |
| topics: 'browsingTopics'in document ? true : false, | |
| attributionReporting: document.featurePolicy.allowsFeature('attribution-reporting') ? true : false, | |
| protectedAudience: 'runAdAuction'in navigator ? true : false, | |
| fencedFrames: 'HTMLFencedFrameElement'in window ? true : false, | |
| sharedStorage: 'sharedStorage'in window ? true : false, |
NewerOlder