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, |
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
// Returns a list of current Optimize Containers on a page | |
alert(`Found Optimize Containers: ${Object.keys(window.google_tag_manager || []).filter(e=> e.match(/^(GTM|OPT)/) && !window.google_tag_manager[e].onHtmlFailure)}`) |
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
var getGa4LinkerParam = function() { | |
try { | |
if (!window.google_tag_data || !window.google_tag_data.glBridge) | |
return; | |
var cookies = {}; | |
('; ' + document.cookie).split('; ').forEach(function(ck) { | |
var name = ck.split("=")[0]; | |
var value = ck.split("=")[1]; | |
if (name && value && name.match(/^_ga$|^_ga_[A-Z,0-9]/)) { | |
cookies[name] = value.match(/[A-Z,0-9]\.[0-9]\.(.*)/)[1]; |
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() { | |
/* | |
* | |
* ( David Vallejo @thyng ) | |
* MIT License | |
* Remap _et ( Event Time ) as a customEvent Perameter | |
* | |
*/ | |
try { | |
// Monkey Patch, sendBeacon |
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
<!-- Cloudflare Web Analytics --> | |
<script> | |
(function(){ | |
var s, | |
r, | |
t; | |
r = false; | |
s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.src = 'https://static.cloudflareinsights.com/beacon.min.js'; |
NewerOlder