Visão Geral
Dados da landing pública multiconect.com.br
Rastreando ao vivo
Últimas 24h
Últimos 7 dias
Últimos 30 dias
Últimos 60 dias
Exportar
Carregando analytics da landing...
`; } function drawHeatmap() { const canvas = document.getElementById("heatmap-canvas"); if (!canvas || !state.dashboard) return; const parentWidth = canvas.parentElement.clientWidth || 960; canvas.width = parentWidth; const ctx = canvas.getContext("2d"); const width = canvas.width; const height = canvas.height; ctx.clearRect(0, 0, width, height); ctx.fillStyle = "#0a0d14"; ctx.fillRect(0, 0, width, height); ["Hero", "Benefícios", "Experiência", "Como funciona", "Diferenciais", "CTA", "FAQ"].forEach((label, index) => { const y = (index / 7) * height; ctx.strokeStyle = "rgba(255,255,255,0.06)"; ctx.beginPath(); ctx.moveTo(0, y); ctx.lineTo(width, y); ctx.stroke(); ctx.fillStyle = "rgba(255,255,255,0.3)"; ctx.font = "12px Plus Jakarta Sans"; ctx.fillText(label, 12, y + 18); }); state.dashboard.heatmapPoints.forEach((point) => { const x = point.xRatio * width; const y = point.yRatio * height; const gradient = ctx.createRadialGradient(x, y, 0, x, y, 72); gradient.addColorStop(0, "rgba(255,0,0,0.82)"); gradient.addColorStop(0.45, "rgba(255,153,0,0.46)"); gradient.addColorStop(1, "rgba(0,255,120,0)"); ctx.fillStyle = gradient; ctx.fillRect(0, 0, width, height); }); } function exportCsv() { const dashboard = state.dashboard; if (!dashboard) return; const csv = [ ["Métrica", "Valor"], ["Visitantes Únicos", dashboard.overview.uniqueVisitors], ["Pageviews", dashboard.overview.pageviews], ["Tempo Médio", formatDuration(dashboard.overview.averageDurationSeconds)], ["Taxa de Conversão", `${dashboard.overview.conversionRate}%`], ["Taxa de Rejeição", `${dashboard.overview.bounceRate}%`], ["Usuários ao Vivo", dashboard.overview.liveUsers] ].map((row) => row.join(",")).join("\n"); const blob = new Blob([csv], { type: "text/csv;charset=utf-8" }); const url = URL.createObjectURL(blob); const link = document.createElement("a"); link.href = url; link.download = "multiconect-landing-analytics.csv"; link.click(); URL.revokeObjectURL(url); } $$(".sb-item").forEach((item) => { item.addEventListener("click", () => nav(item.dataset.page)); }); adminKeyInput.addEventListener("change", () => { state.adminKey = adminKeyInput.value.trim(); localStorage.setItem("multiconect_lp_admin_key", state.adminKey); fetchDashboard(); }); rangeSelect.addEventListener("change", () => { state.rangeDays = Number(rangeSelect.value || 30); fetchDashboard(); }); $("#export-btn").addEventListener("click", exportCsv); fetchDashboard(); })();