My Dashboard nav shortcut + analytics whitelist fix for engaged/ctb-offer
nav-dash.js on all header pages: a top-right My Dashboard button when the visitor is known (msg session from wallet sign-in or the Mini App bridge is authoritative; else the last dashboard opened on the device). Prospects with no identity never see it. recordEvent was silently dropping the new engaged + ctb-offer-* events (whitelist); now recorded per source, with admin funnel tiles for both. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -349,7 +349,7 @@ function getConfig() { return readJson(CONFIG_FILE); }
|
||||
function activeSponsor(sponsors) { return sponsors.find(s=>s.status==='active') || sponsors.find(s=>s.status==='waiting') || null; }
|
||||
function getAnalytics() { try { return readJson(ANALYTICS_FILE); } catch (e) { return { sources: {} }; } }
|
||||
function recordEvent(event, source) {
|
||||
if (!['bridge','start','click','training','postback','purchase','join','joinnow'].includes(event)) return;
|
||||
if (!['bridge','start','click','training','postback','purchase','join','joinnow','engaged'].includes(event) && !String(event).startsWith('ctb-offer-')) return;
|
||||
const s = String(source||'').toLowerCase().trim().replace(/[^a-z0-9.()\-_:/ ]/g,'').slice(0,80) || '(direct)';
|
||||
const a = getAnalytics(); if (!a.sources) a.sources = {};
|
||||
if (!a.sources[s]) { if (Object.keys(a.sources).length >= 500) return; a.sources[s] = { bridge:0, start:0, click:0 }; }
|
||||
|
||||
Reference in New Issue
Block a user