small fixes to tracking script and to ui
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user