Skip to content

feat(marketing): Visitor Intelligence funnel dashboard (backlog #23) - #315

Merged
NewWorldVenture merged 1 commit into
mainfrom
claude/loving-mccarthy-e1ahq8
Jul 12, 2026
Merged

NewWorldVenture merged 1 commit into
mainfrom
claude/loving-mccarthy-e1ahq8

Conversation

@NewWorldVenture

Copy link
Copy Markdown
Owner

What & why

Backlog #23 — Dedicated /admin/visitor-intelligence/* dashboard (Agent, ★☆☆☆☆). This caps the visitor-intelligence lane (#4 consent → #6 identity → #13 profiling → #14 scoring, all merged) with one owner-facing view that ties them together: the acquisition funnel end-to-end.

Changes

  • lib/marketing/visitor-funnel.ts (pure, 6 tests): buildFunnel(counts) → the five stages with safe conversion percentages (share-of-top and step-over-step; 0 when the denominator is 0, negatives clamped).
  • /admin/marketing/visitor-intelligence (super-admin, via the existing admin-layout gate):
    • Acquisition funnel — Anonymous visitors → Identified → Profiled → Scored → Hot/Qualified, with per-stage counts + conversion.
    • Lead score bands distribution (cold / warm / hot / qualified).
    • Consent posture — analytics grants + marketing opt-ins, with the privacy invariants spelled out.
    • Every count is best-effort — a table not applied yet degrades to 0, never a crash.
  • Added "Visitor Funnel" to the marketing sub-nav under Audience & Intelligence.

Verification

  • tsc 0 · eslint 0 · npm run build green (/admin/marketing/visitor-intelligence builds) · full vitest 2446 passed (6 new).
  • No schema or seed change — pure aggregation of existing tables (mkt_visitors, crm_contact_profile, crm_lead_scores, mkt_consent_events); nothing new to apply to prod.

🤖 Generated with Claude Code


Generated by Claude Code

Caps the visitor-intelligence lane with a dedicated admin dashboard that ties
together everything the lane now collects: the acquisition funnel end-to-end
(anonymous visitors → identified → profiled → scored → hot/qualified) with
safe step + share-of-top conversion rates, plus consent posture (analytics
grants, marketing opt-ins) and the lead-score band distribution.

- lib/marketing/visitor-funnel.ts: pure funnel math (buildFunnel + safe pct),
  6 tests.
- /admin/marketing/visitor-intelligence (super-admin, via the admin layout
  gate): funnel bars, lead-band distribution, consent posture card. All counts
  are best-effort (a not-yet-applied table degrades to 0, never a crash).
- Added "Visitor Funnel" to the marketing sub-nav under Audience & Intelligence.

No schema/seed change — pure aggregation of existing tables (mkt_visitors,
crm_contact_profile, crm_lead_scores, mkt_consent_events).
tsc/eslint/build green; full suite 2446 passing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJBpzPzPrBbMzYFSVCQaTM
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
familyos Building Building Preview, Comment Jul 12, 2026 7:58pm

Request Review

@NewWorldVenture
NewWorldVenture marked this pull request as ready for review July 12, 2026 19:58
@NewWorldVenture
NewWorldVenture merged commit b5d013b into main Jul 12, 2026
1 of 4 checks passed

This branch was successfully deployed

1 active deployment
Preview — d6755c7e Deployed Jul 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants