Marketing Attribution Dashboard
Live SQL-powered attribution reporting using PostgreSQL (Supabase), Vercel serverless functions, and Next.js.
Data updates dynamically via API routes querying PostgreSQL with time-based filters.
Total Attributed Revenue
$0
Revenue by Channel
SQL Logic
select campaigns.channel, count(deals.id) as closed_won_deals, round(sum(deals.amount), 2) as revenue from deals join contacts on deals.contact_id = contacts.id join touchpoints on touchpoints.contact_id = contacts.id join campaigns on touchpoints.campaign_id = campaigns.id where deals.stage = 'closed_won' and deals.closed_at >= now() - interval '[selected days] days' group by campaigns.channel order by revenue desc;