System architecture
Lead Source Attribution Dashboard Architecture
- 01a reliable source signal
An operational view that breaks inbound leads down by where they actually came from (form source tag, UTM, referrer, paid vs organic vs referral) a...
- 02a Postgres view that
Write a Postgres view (or materialized view refreshed by Supabase Cron/pg_cron every 15-30 min) that aggregates leads by source_normalized x day/week with count, share %, and prior-period delta.
- 03Supabase Postgres
Supabase Postgres contributes the trusted model for Lead Source Attribution Dashboard so metrics are defined before they are visualized.
- 04SQL views / materialized
Render a server-component dashboard panel (Next.js 16 App Router, same pattern as app/admin/monitoring) with a bar/stack by source plus a small sparkline trend and a date-range selector reading the view via the service-role client.
- 05Review Queue
If attribution coverage is too thin to trust, fall back to a simpler captured-source-tag-only breakdown plus an explicit 'unknown' slice, and flag...
- 06Owner Review
Owners can see, in one place, which channels are actually producing leads and which dried up — turning 'we think most come from referrals' into a s...