small fixes to tracking script and to ui

This commit is contained in:
Doar Mihai
2026-03-28 13:21:29 +02:00
parent 8a5aef0b13
commit d5f7793337
3 changed files with 12 additions and 12 deletions
+4 -6
View File
@@ -128,7 +128,7 @@
}
}
// ---- Send Beacon ----
// ---- Send Data ----
function send(data) {
var vid = getVisitorId();
@@ -156,15 +156,13 @@
os_version: os.version.substring(0, 20),
}, utm, data);
var blob = new Blob([JSON.stringify(payload)], { type: "application/json" });
if (navigator.sendBeacon) {
navigator.sendBeacon(COLLECT_URL, blob);
} else {
try {
var xhr = new XMLHttpRequest();
xhr.open("POST", COLLECT_URL, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(payload));
} catch(e) {
// Silent fail
}
}