-- Blended Customer Acquisition Cost (CAC) -- Sums total marketing spend across all channels and divides by total customers acquired WITH total_spend AS ( SELECTSUM(spend_usd) as usd_spent FROM marketing_spend WHERE date BETWEEN:start_dateAND:end_date
),
new_customers AS ( SELECTCOUNT(DISTINCT customer_id) as customer_count FROM customers WHERE start_date BETWEEN:start_dateAND:end_date
) SELECT COALESCE(usd_spent, 0) / NULLIF(customer_count, 0) as blended_cac FROM total_spend, new_customers;
SQL Source: Customer Lifetime Value (LTV)
-- Customer Lifetime Value (LTV) -- Formula: (ARPU * Gross Margin %) / Monthly Churn Rate -- Gross Margin is hardcoded to 82% based on audited SaaS financials WITH arpu_calc AS ( SELECTAVG(mrr) as avg_mrr FROM customers WHERE start_date <= :end_date
),
churn_calc AS ( SELECT
(SELECTCOUNT(DISTINCT customer_id) FROM customers WHERE status = 'churned'AND end_date BETWEEN:start_dateAND:end_date)::float / NULLIF((SELECTCOUNT(DISTINCT customer_id) FROM customers WHERE start_date < :start_date), 0) as monthly_churn
) SELECT
(avg_mrr * 0.82) / NULLIF(monthly_churn, 0) as customer_ltv FROM arpu_calc, churn_calc;
SQL Source: LTV:CAC Ratio
-- LTV:CAC Ratio -- Computes the ratio of Customer Lifetime Value to Customer Acquisition Cost WITH cac_calc AS ( SELECTSUM(spend_usd) / NULLIF(COUNT(DISTINCT c.customer_id), 0) as cac FROM marketing_spend s JOIN customers c ON c.start_date = s.date WHERE s.date BETWEEN:start_dateAND:end_date
),
ltv_calc AS ( SELECT
(AVG(mrr) * 0.82) / NULLIF(
(SELECTCOUNT(DISTINCT customer_id) FROM customers WHERE status = 'churned'AND end_date BETWEEN:start_dateAND:end_date)::float / NULLIF((SELECTCOUNT(DISTINCT customer_id) FROM customers WHERE start_date < :start_date), 0), 0
) as ltv FROM customers WHERE start_date <= :end_date
) SELECT ltv / NULLIF(cac, 0) as ltv_to_cac_ratio FROM ltv_calc, cac_calc;
SQL Source: CAC Payback Period
-- CAC Payback Period (in Months) -- Formula: CAC / (Monthly ARPU * Gross Margin %) WITH cac_calc AS ( SELECTSUM(spend_usd) / NULLIF(COUNT(DISTINCT c.customer_id), 0) as cac FROM marketing_spend s JOIN customers c ON c.start_date = s.date WHERE s.date BETWEEN:start_dateAND:end_date
),
arpu_calc AS ( SELECTAVG(mrr) as avg_mrr FROM customers WHERE start_date <= :end_date
) SELECT cac / NULLIF((avg_mrr * 0.82), 0) as payback_months FROM cac_calc, arpu_calc;
First-Party Conversion FunnelMTD Volume
Sessions
0
100.0%
8.0% Conv
Leads
0
8.0%
50.0% Conv
MQLs
0
4.0%
29.0% Conv
SQLs
0
1.2%
30.0% Conv
Opportunities
0
0.3%
35.0% Conv
Customers
0
0.1%
First-Party Channel PerformancePipeline ROI Match
Channel
Spend
SQLs
Customers
CAC
ROI
Branded Demand & Direct Traffic TrendsLast 12 Weeks (Weekly Grain)