1
0
mirror of https://github.com/XFox111/my-website.git synced 2026-04-22 07:28:01 +03:00

fix: cookie consent tracking breaks when CDN caching is involved

This commit is contained in:
2024-10-24 16:20:34 +00:00
parent 5a4b67d83e
commit f2e985cfea
5 changed files with 25 additions and 21 deletions
+2 -1
View File
@@ -30,7 +30,8 @@
/** @type {string | undefined} */
const id = document.getElementById("ms-clarity")?.dataset.id;
if (!id)
// If "Do Not Track" is enabled, or there's no CLARITY_ID set up, we don't load any analytics
if (!id || navigator.doNotTrack === "1")
return;
window["clarity"] ??= function ()