Admin analytics: heatmap per device, anteprima staff e analisi costi.
Separa heatmap mobile/desktop, opt-out analytics per operatori, dashboard costi con KPI e trend mensili. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,6 +29,11 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
function isAnalyticsSuppressed() {
|
||||
var meta = document.querySelector("meta[name='mltv-analytics-suppress']");
|
||||
return meta && meta.getAttribute("content") === "1";
|
||||
}
|
||||
|
||||
function hasAnalyticsConsent() {
|
||||
try {
|
||||
var raw = localStorage.getItem(STORAGE_KEY);
|
||||
@@ -104,7 +109,7 @@
|
||||
|
||||
function flush(useBeacon) {
|
||||
flushMovesIntoQueue();
|
||||
if (!queue.length || !hasAnalyticsConsent()) {
|
||||
if (!queue.length || !hasAnalyticsConsent() || isAnalyticsSuppressed()) {
|
||||
queue = [];
|
||||
return;
|
||||
}
|
||||
@@ -236,7 +241,7 @@
|
||||
}
|
||||
|
||||
function captureSnapshot() {
|
||||
if (!hasAnalyticsConsent() || alreadyCapturedToday()) return;
|
||||
if (!hasAnalyticsConsent() || isAnalyticsSuppressed() || alreadyCapturedToday()) return;
|
||||
loadHtml2Canvas(function (html2canvas) {
|
||||
var size = pageSize();
|
||||
html2canvas(document.documentElement, {
|
||||
@@ -281,6 +286,7 @@
|
||||
function start() {
|
||||
if (started) return;
|
||||
if (excludedPath(location.pathname)) return;
|
||||
if (isAnalyticsSuppressed()) return;
|
||||
if (!hasAnalyticsConsent()) return;
|
||||
started = true;
|
||||
maxScroll = scrollPct();
|
||||
|
||||
Reference in New Issue
Block a user