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:
2026-08-28 19:25:38 +02:00
co-authored by Cursor
parent e0e07e5316
commit 29c8afb94d
43 changed files with 1572 additions and 58 deletions
+10
View File
@@ -37,6 +37,11 @@
return document.body && document.body.getAttribute("data-ga-id");
}
function isAnalyticsSuppressed() {
var meta = document.querySelector("meta[name='mltv-analytics-suppress']");
return meta && meta.getAttribute("content") === "1";
}
function loadGoogleAnalytics() {
var id = measurementId();
if (!id || window.__mltvGaLoaded) return;
@@ -68,6 +73,7 @@
}
function applyConsent(consent) {
if (isAnalyticsSuppressed()) return;
if (consent && consent.analytics) {
loadGoogleAnalytics();
if (typeof window.mltvSiteAnalyticsStart === "function") {
@@ -94,6 +100,10 @@
if (acceptAll) {
acceptAll.addEventListener("click", function () {
if (isAnalyticsSuppressed()) {
hideBanner(banner);
return;
}
var c = writeConsent({ analytics: true });
applyConsent(c);
hideBanner(banner);