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:
martbost
2026-08-24 07:10:52 -05:00
parent b950e378d1
commit a0642516e1
11 changed files with 41 additions and 12 deletions
+5 -3
View File
@@ -8,8 +8,8 @@ function statusClass(s){return `status status-${s}`}
function pct(n,d){return d?`${Math.round((n/d)*100)}%`:'—'}
function renderAnalytics(){
const src=(state.analytics&&state.analytics.sources)||{};
const tot={bridge:0,start:0,click:0,training:0,postback:0,purchase:0,join:0,joinnow:0};
const list=Object.entries(src).map(([name,r])=>{tot.bridge+=r.bridge||0;tot.start+=r.start||0;tot.click+=r.click||0;tot.training+=r.training||0;tot.postback+=r.postback||0;tot.purchase+=r.purchase||0;tot.join+=r.join||0;tot.joinnow+=r.joinnow||0;return{name,bridge:r.bridge||0,start:r.start||0,click:r.click||0,training:r.training||0,join:r.join||0,joinnow:r.joinnow||0,purchase:r.purchase||0}})
const tot={bridge:0,start:0,click:0,training:0,postback:0,purchase:0,join:0,joinnow:0,engaged:0,ctbCredited:0};
const list=Object.entries(src).map(([name,r])=>{tot.bridge+=r.bridge||0;tot.start+=r.start||0;tot.click+=r.click||0;tot.training+=r.training||0;tot.postback+=r.postback||0;tot.purchase+=r.purchase||0;tot.join+=r.join||0;tot.joinnow+=r.joinnow||0;tot.engaged+=r.engaged||0;tot.ctbCredited+=r['ctb-offer-credited']||0;return{name,bridge:r.bridge||0,start:r.start||0,click:r.click||0,training:r.training||0,join:r.join||0,joinnow:r.joinnow||0,purchase:r.purchase||0}})
.sort((a,b)=>b.click-a.click||b.start-a.start||b.bridge-a.bridge);
document.getElementById('funnelStats').innerHTML=
`<div class="fact"><small>Bridge views</small><strong>${tot.bridge}</strong></div>`+
@@ -21,7 +21,9 @@ function renderAnalytics(){
(tot.joinnow?`<div class="fact"><small>Join-now views</small><strong>${tot.joinnow}</strong></div>`:'')+
(tot.purchase?`<div class="fact"><small>Confirmed joins</small><strong>${tot.purchase}</strong></div>`:'')+
(tot.joinnow&&tot.purchase?`<div class="fact"><small>Join-now → Confirmed</small><strong>${pct(tot.purchase,tot.joinnow)}</strong></div>`:'')+
(tot.postback?`<div class="fact"><small>BeMob postbacks</small><strong>${tot.postback}</strong></div>`:'');
(tot.postback?`<div class="fact"><small>BeMob postbacks</small><strong>${tot.postback}</strong></div>`:'')+
(tot.engaged?`<div class="fact"><small>Engaged 30s+ visits</small><strong>${tot.engaged}</strong></div>`:'')+
(tot.ctbCredited?`<div class="fact"><small>CTB offer credits</small><strong>${tot.ctbCredited}</strong></div>`:'');
const subs=state.submissions||[];
document.getElementById('submissionRows').innerHTML=subs.map(s=>{
const path=s.path==='rotation'?'<span class="status status-active">rotation</span> ':s.path==='leg'?'<span class="status status-qualified">leg</span> ':'';