Business Metrics and Unit Economics Questions
The economics of how a business makes money, computed at the per-customer and per-unit level. Covers customer acquisition cost (blended and by channel, including which spend to include and how to allocate shared costs), customer lifetime value (simple, cohort-based, discounted, and probabilistic or censored-data estimates such as Pareto/NBD and Monte Carlo uncertainty), LTV:CAC ratio and CAC payback period, ARPU and ARPPU, gross, contribution and operating margin, and cost allocation across units. Includes subscription revenue metrics (MRR, ARR, expansion, contraction, customer versus revenue churn and net revenue retention, and how revenue recognition, discounts and refunds affect reported figures), marketplace and delivery economics (take rate, GMV, per-order contribution, supply-side value, break-even), cohort revenue curves, and sensitivity analysis on churn, price and acquisition cost. Reasons about what moves these numbers and whether growth is efficient: diagnosing a falling LTV, a rising CAC or a shrinking margin, deciding whether to scale a channel or segment, and presenting unit economics to executives. Includes SQL and spreadsheet implementations of these calculations. Also covers the growth-metric vocabulary and its arithmetic: AARRR metric mapping, activation-rate definitions, viral coefficient (K-factor) and referral conversion math, and churn and retention rate formulas, defined and computed as inputs to unit economics rather than as growth interventions. Metric governance, dashboard and pipeline engineering, attribution, experimentation, forecasting method and pricing strategy are covered elsewhere.
LTV dropped 15% last quarter. You have channel mix, cohort retention, ARPU breakdown, support ticket volumes and feature adoption data. Lay out an investigation plan, with specific calculations, that isolates whether the cause is pricing, churn, channel quality or a product regression.
Sample Answer
Direct answer
Write LTV (lifetime value) as ARPU (average revenue per user per month) x gross margin (revenue left after direct serving costs) / churn (share of customers cancelling each month), then break the 15% drop into the part each driver explains (first action: check the data, then the decomposition), in this order: data correctness first, then mix versus rate by channel (channel quality), then churn by cohort, then ARPU components (pricing), then product regression using feature adoption and support tickets. Each step has a specific calculation and a result that rules a cause in or out.
Investigation plan
- Rule out data and definition changes. Recompute last quarter's LTV with this quarter's definitions and vice versa; check for a changed churn definition, late billing data or missing cohorts. If the drop vanishes, it was measurement.
- Decompose LTV. LTV = ARPU x margin / churn. Compute each term for both quarters: which moved? Margin rarely moves quickly; ARPU or churn does.
- Channel quality (mix versus rate). Compute LTV per acquisition channel, then split the change into a mix effect (the channel shares changed while each channel's LTV is held at its old value) and a rate effect (each channel's own LTV changed). The code below computes exactly these two pieces. A big mix effect points at channel quality: more customers from low-LTV channels.
- Churn by cohort (customers grouped by signup month). Plot retention curves (the share still active by months since signup) by signup month. A drop in early-life retention for recent cohorts points to onboarding, product or channel quality; a drop across old cohorts at one calendar date points to a product or pricing event.
- ARPU breakdown (pricing). Split ARPU into list price, plan mix and discounts. A falling plan mix (the share of customers on each plan, here a shift to cheaper plans) or deeper discounts at a pricing change indicate pricing; price increases followed by rising churn indicate elasticity (customers' sensitivity to price: the more demand falls when price rises, the more elastic).
- Product regression (a release that made the product worse, not the statistical technique). Overlay release dates with feature adoption (share of new customers using the core feature in week 1) and support tickets per customer. A step change in tickets and a drop in adoption right after a release implicates the product.
Worked example (illustrative, pinned and reproducible)
GM = 0.75
# channel: (share of new customers, ARPU $/month, monthly churn) illustrative
prev = {"Organic": (0.40, 40.0, 0.020), "Paid": (0.45, 36.0, 0.035), "Partner": (0.15, 45.0, 0.025)}
curr = {"Organic": (0.28, 40.0, 0.020), "Paid": (0.62, 36.0, 0.040), "Partner": (0.10, 45.0, 0.025)}
def ltv(arpu, churn):
return arpu * GM / churn
def blended(book):
return sum(sh * ltv(a, c) for sh, a, c in book.values())
p, c = blended(prev), blended(curr)
print("prev LTV", round(p, 2), "curr LTV", round(c, 2), "change", round((c / p - 1) * 100, 1), "%")
mix_only = sum(curr[k][0] * ltv(prev[k][1], prev[k][2]) for k in prev)
print("mix effect $", round(mix_only - p, 2))
print("rate effect $", round(c - mix_only, 2))
for k in prev:
print(k, "LTV", round(ltv(prev[k][1], prev[k][2]), 2), "->", round(ltv(curr[k][1], curr[k][2]), 2))
Output:
prev LTV 1149.64 curr LTV 973.5 change -15.3 %
mix effect $ -116.36
rate effect $ -59.79
Organic LTV 1500.0 -> 1500.0
Paid LTV 771.43 -> 675.0
Partner LTV 1350.0 -> 1350.0
Reading the result
- Blended LTV fell 15.3%, from $1,149.64 to $973.50, a $176.14 drop.
- Mix effect: -$116.36 (about 66% of the drop). Paid, the lowest-LTV channel, went from 45% to 62% of new customers while Organic fell from 40% to 28%. That is a channel-quality (mix) story.
- Rate effect: -$59.79 (about 34%). All of it sits in Paid, where churn rose from 3.5% to 4.0% (LTV $771.43 to $675.00, down 12.5%). Paid ARPU did not move ($36 both quarters), so pricing is ruled out in this example, and Organic and Partner LTV did not move, so a product regression is unlikely (it would hit every channel). The remaining suspect is the quality of the newly bought paid audience.
How each cause shows up
| Cause | Signature in the data | Calculation that confirms |
|---|---|---|
| Pricing | ARPU falls or discounts deepen across channels at a pricing date; churn may rise if prices rose | ARPU split into list price, plan mix, discount rate, by cohort |
| Churn | Retention curve of recent cohorts below older ones | Month-1 and month-3 retention by signup month and by channel |
| Channel quality | Mix shift to low-LTV channels, or lower retention only within one channel | Mix versus rate decomposition above |
| Product regression | Every channel and old cohorts worsen after a release date; core-feature adoption drops; tickets per customer jump | Before versus after the release date, adopters versus non-adopters |
Quick numeric checks for the other three branches (illustrative)
- Pricing: a deeper discount cuts ARPU from $40 to $36 in every channel with churn flat at 2%. LTV goes from 40 x 0.75 / 0.02 = $1,500 to 36 x 0.75 / 0.02 = $1,350, a 10% fall in all channels at once.
- Churn by cohort: the January cohort has 78% of customers left after 3 months and the April cohort 66%. The gap appears in recent signups only, so look at what changed in acquisition or onboarding rather than at the whole base.
- Product regression: after a release on 1 March, week-1 adoption of the core feature drops from 60% to 45% in every channel and tickets per customer double. Old cohorts worsen at the same date too.
Decision
Here I would cap or reshape the new Paid campaigns, since they drive both the mix shift and the within-channel churn rise, and ask for onboarding or targeting changes for that audience. I would also compare against CAC: if the extra Paid customers are cheaper, a lower LTV may still be acceptable, so judge on LTV:CAC (lifetime value divided by acquisition cost) and payback, not LTV alone. What would change my call: if step 1 showed a definition change, or if Organic retention had also fallen, I would investigate the product first.
Pitfalls
Skipping the data check, reading blended LTV as one number when it is a weighted average of segments, concluding "product" because churn rose without checking whether it rose in every channel, and presenting a projected LTV for young cohorts as if it were observed.
A B2B SaaS company targets LTV:CAC of 3.0. One channel sits at 1.2 but is growing fast and brings in half of new signups. Draft a one-page recommendation: pause, optimise or scale? Name two analyses you would run immediately to cut uncertainty and one short-term action.
Sample Answer
Direct answer
Optimise, do not pause and do not scale. Hold the channel's spend at today's level for six weeks, run two analyses that test the two inputs I trust least (the lifetime value and the attribution), and decide with thresholds agreed in advance. The channel brings half of new signups, so pausing is expensive to reverse, and a ratio of 1.2 against a target of 3.0 is too weak to justify adding money.
Terms: LTV:CAC is the gross-profit lifetime value of a customer divided by the cost to acquire them (customer acquisition cost, CAC); attribution is the rule that assigns a signup to a channel; incrementality is the share of attributed customers who would not have arrived without the spend.
The one-page recommendation (illustrative figures: CAC $500, LTV $600)
Recommendation: optimise (hold spend flat, trim the weakest campaigns, decide in six weeks).
Situation. Channel X has LTV:CAC of 1.2 against our 3.0 target and drives about half of new signups. Reported CAC is $500 per paying customer and gross-margin LTV is $600, modelled from blended retention.
Why not pause. A ratio above 1.0 means each customer still returns more than they cost, if both inputs are right. Pausing removes half the top of the funnel, and restarting later means losing learning and audience history. Why not scale. At 1.2 each added dollar loses ground against the target, and marginal CAC normally rises with spend.
Two analyses now. (1) Rebuild LTV from this channel's own cohort retention, margin-adjusted, instead of the blended model. (2) Measure incrementality with a holdout (a region or time window where the spend is withheld) so CAC reflects customers the spend actually caused.
Short-term action. Freeze channel spend at its current level for six weeks.
Decision rule, agreed before results. Incremental, cohort-based ratio below 1.0: cut back sharply. Between 1.0 and 3.0: hold and optimise campaign by campaign. 3.0 or above on marginal spend: scale in stages.
Risk. If the real ratio is near the low end we burn money for six weeks, a bounded cost. If we pause and it was the high end, we lose customers we cannot easily win back.
Why these two analyses cut the most uncertainty
The ratio can be wrong in the numerator (LTV) or the denominator (CAC), so each analysis targets one.
# Illustrative channel numbers
cac_reported = 500 # $ per attributed paying customer
ltv_reported = 600 # $ gross-margin LTV, modelled from blended retention
print("reported ratio", ltv_reported / cac_reported)
# Analysis 1: replace modelled LTV with the channel's own cohort retention
for ltv in (450, 600, 900, 1100):
print("LTV", ltv, "ratio", round(ltv / cac_reported, 2))
# Analysis 2: incrementality. Share of attributed customers who would NOT have arrived without the spend
for inc in (1.0, 0.8, 0.6, 0.4):
true_cac = cac_reported / inc
print("incremental share", inc, "true CAC", round(true_cac), "ratio", round(ltv_reported / true_cac, 2))
# Combined best and worst
print("worst", round(450 / (500 / 0.6), 2), "best", round(1100 / (500 / 1.0), 2))
Output:
reported ratio 1.2
LTV 450 ratio 0.9
LTV 600 ratio 1.2
LTV 900 ratio 1.8
LTV 1100 ratio 2.2
incremental share 1.0 true CAC 500 ratio 1.2
incremental share 0.8 true CAC 625 ratio 0.96
incremental share 0.6 true CAC 833 ratio 0.72
incremental share 0.4 true CAC 1250 ratio 0.48
worst 0.54 best 2.2
- Cohort LTV. If the channel's own cohorts are worth $450 the ratio is 0.9; at $1,100 it is 2.2. The width of that range is the uncertainty analysis 1 removes.
- Incrementality. If only 60% of attributed customers are incremental, true CAC is $500 / 0.6 = $833 and the ratio is 0.72. At 80% it is 0.96.
- Both together. The worst corner is 450 / (500 / 0.6) = 0.54 and the best 1,100 / 500 = 2.2. Even the best case is below 3.0, so scaling is off the table either way. The analyses decide among cutting back, trimming and holding, not whether to scale: the worst corner (0.54) falls in the 'cut back sharply' band of the decision rule and the best (2.2) in the 'hold and optimise' band.
Trade-offs and pitfalls
- Signups are not paying customers. Compute everything per paying customer so numerator and denominator share a basis.
- A freeze is chosen because it is cheap, bounded and reversible. It is a different action from "keep going as before", because the decision date and thresholds are fixed up front.
- What would change the call: cohort LTV near the top of the range together with high incrementality (then test staged scaling), or a holdout showing most of these customers would have arrived anyway (then cut hard).
Explain CAC payback period. With CAC of $240, ARPU of $20/month and an 80% gross margin, compute the payback in months and explain why gross margin belongs in the calculation.
Sample Answer
Direct answer
CAC (customer acquisition cost) payback period is the number of months of gross profit needed to earn back what you spent to acquire a customer. With CAC $240, ARPU (average revenue per user) $20 a month and gross margin 80%: gross profit (revenue minus the direct cost of serving the customer) is $20 x 0.80 = $16 a month, where 80% is the gross margin (the share of revenue left after those direct costs), so payback is $240 / $16 = 15 months. Gross margin belongs in the calculation because you recover CAC out of what is left after the direct cost of serving the customer, not out of revenue; using revenue would give $240 / $20 = 12 months and understate the payback by 20%.
Gross margin versus contribution margin
Gross margin is revenue minus cost of goods sold (hosting, payment fees, direct support), as a share of revenue. Contribution margin goes further and subtracts other variable costs that scale with each customer. Example: ARPU $20 with $5 of variable cost leaves a $15 contribution per month; with CAC $120, payback is $120 / $15 = 8 months. Use the margin that matches costs that really go away if you lose the customer.
Sensitivity of payback to CAC and ARPU
Payback = CAC / (ARPU x margin), so it moves proportionally with CAC and inversely with ARPU.
| Change | Gross profit per month | Payback |
|---|---|---|
| Base: CAC $240, ARPU $20 | $16 | 15.0 months |
| CAC up 20% to $288 | $16 | 18.0 months |
| CAC down 20% to $192 | $16 | 12.0 months |
| ARPU up 20% to $24 | $19.20 | 12.5 months |
| ARPU down 20% to $16 | $12.80 | 18.75 months |
A 20% change in either input moves payback by about 2.5 to 4 months, so check which input you trust least.
Effect of churn
The simple formula treats every customer as staying until payback. If customers churn, a cohort recovers less per month. With monthly churn c (the share of customers who leave each month), the share still active in month k is (1-c)^(k-1), so a customer acquired in month 1 is expected to pay $16 in month 1, $16 x (1-c) in month 2, $16 x (1-c)^2 in month 3, and so on. Summing that geometric series, expected gross profit collected by month n is $16 x (1 - (1-c)^n) / c. Check at c = 3%: month 1 collects $16, month 2 adds $15.52, month 3 adds $15.05, and the running total after 3 months is $46.57 (the formula gives 16 x (1 - 0.97^3) / 0.03 = $46.57). Setting the formula to $240:
- c = 3%: 0.97^n <= 0.55, so n >= 19.6, payback month 20.
- c = 5%: 0.95^n <= 0.25, so n >= 27.0, payback month 28.
So at 5% churn the 15-month headline is closer to 28 months for the cohort as a whole. If churn is high, payback is a worse guide than LTV:CAC (the ratio of LTV, the lifetime gross profit per customer, to CAC).
Seasonality, cohort timing and discounting
- Seasonality (a regular pattern tied to the calendar). CAC is often higher in peak-competition months and ARPU may be lower in promotional ones; payback for a January cohort is not comparable to a July cohort. Compare cohorts like for like or smooth over the year.
- Cohort timing. A cohort is the customers acquired in the same month. Payback must be read by acquisition cohort: recent cohorts have not had time to show their payback, so use a projection and label it as such. Example: a cohort acquired 6 months ago has collected at most 6 x $16 = $96 per customer, 40% of the $240 CAC, so its payback cannot be observed yet.
- Discounting. For long paybacks, a dollar in month 15 is worth less than a dollar today, so discounted payback is longer. Worked example at a 10% yearly discount rate (about 0.8% a month): with no churn, the undiscounted payback is 15 months but the discounted payback (each month's $16 shrunk to today's value before summing) is 17 months. At short paybacks (under a year) it matters little.
Decision use
Payback is a cash and risk measure. A 15-month payback is acceptable for a well-funded business with low churn and tight for one funding growth from a thin cash cushion. I would pair it with the ratio and churn.
Using acquisitions(user_id, acquired_at, channel, cac_amount) and a revenue table, write SQL that shows, for each acquisition-month cohort, cumulative contribution margin per acquired user at months 1 to 12 and the first month it exceeds CAC.
Sample Answer
Direct answer
Join each acquisition cohort (users acquired in the same month) to their revenue, convert each revenue date into a month number since acquisition, sum contribution margin (revenue minus the variable cost of serving it) by cohort and month, divide by the number of acquired users (including those who never paid), take a running total over month_n 1 to 12, and compare it with the cohort's average CAC (customer acquisition cost). The payback month is the first month where the running total exceeds CAC. Cells for months that have not fully elapsed must come back NULL, not zero.
Assumptions about the tables
acquisitions(user_id, acquired_at, channel, cac_amount) as given, with cac_amount the CAC allocated to that user. The revenue table is assumed to be revenue(user_id, revenue_date, amount, variable_cost), where variable_cost is payment fees, hosting and support attributable to that revenue. If your table has only revenue, apply a margin rate instead. Month 1 is the first month after acquisition (offset 0 to under one month).
The query
The script generates 1,200 users (100 a month through 2024, five CAC levels from $40 to $80, $15 monthly revenue with $4.50 cost for each user's lifetime) in a demo schema, runs the query with a data cut-off of 2025-03-31, and prints two cohorts at selected months (the window function and CTE steps are explained after the output).
DROP SCHEMA IF EXISTS demo CASCADE;
CREATE SCHEMA demo;
SET search_path = demo;
CREATE TABLE acquisitions (user_id int PRIMARY KEY, acquired_at date NOT NULL, channel text, cac_amount numeric(10,2));
CREATE TABLE revenue (user_id int, revenue_date date, amount numeric(10,2), variable_cost numeric(10,2));
CREATE INDEX ON revenue (user_id, revenue_date);
-- 100 users a month, Jan to Dec 2024; CAC per user is $40, $50, $60, $70 or $80
INSERT INTO acquisitions
SELECT g, (date '2024-01-01' + ((g - 1) / 100) * interval '1 month')::date + (g % 28),
CASE WHEN g % 2 = 0 THEN 'paid_social' ELSE 'search' END,
40 + (g % 5) * 10
FROM generate_series(1, 1200) g;
-- $15 a month of revenue with $4.50 of variable cost, for 1 + (id*7 mod 15) months, up to the data cut-off
INSERT INTO revenue
SELECT a.user_id, (a.acquired_at + k * interval '1 month')::date, 15.00, 4.50
FROM acquisitions a, generate_series(0, 14) k
WHERE k < 1 + (a.user_id * 7) % 15
AND (a.acquired_at + k * interval '1 month')::date <= date '2025-03-31';
WITH params AS (SELECT DATE '2025-03-31' AS as_of),
cohort AS ( -- one row per acquisition month
SELECT date_trunc('month', acquired_at)::date AS cohort_month,
count(*) AS users,
sum(cac_amount) / count(*) AS cac_per_user,
max(acquired_at) AS last_acquired
FROM acquisitions
GROUP BY 1
),
months AS (SELECT generate_series(1, 12) AS month_n),
cm AS ( -- contribution margin by cohort and month number (1 = first 30-ish days)
SELECT date_trunc('month', a.acquired_at)::date AS cohort_month,
(extract(year FROM age(r.revenue_date, a.acquired_at)) * 12
+ extract(month FROM age(r.revenue_date, a.acquired_at)))::int + 1 AS month_n,
sum(r.amount - r.variable_cost) AS cm
FROM acquisitions a
JOIN revenue r ON r.user_id = a.user_id AND r.revenue_date >= a.acquired_at
GROUP BY 1, 2
),
grid AS ( -- every cohort x month 1..12, zero where nobody paid, NULL-out unobserved cells
SELECT c.cohort_month, c.users, c.cac_per_user, m.month_n,
COALESCE(cm.cm, 0) AS cm,
(c.last_acquired + make_interval(months => m.month_n)) <= (p.as_of + 1) AS observed
FROM cohort c
CROSS JOIN months m
CROSS JOIN params p
LEFT JOIN cm ON cm.cohort_month = c.cohort_month AND cm.month_n = m.month_n
),
cum AS (
SELECT *,
sum(cm) OVER (PARTITION BY cohort_month ORDER BY month_n) / users AS cum_cm_per_user
FROM grid
),
flagged AS ( -- compute payback over ALL months before any display filter
SELECT *,
min(month_n) FILTER (WHERE observed AND cum_cm_per_user > cac_per_user)
OVER (PARTITION BY cohort_month) AS first_month_above_cac
FROM cum
)
SELECT cohort_month, month_n,
round(cac_per_user, 2) AS cac_per_user,
CASE WHEN observed THEN round(cum_cm_per_user, 2) END AS cum_cm_per_user,
first_month_above_cac
FROM flagged
WHERE cohort_month IN ('2024-01-01', '2024-11-01') AND month_n IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 12)
ORDER BY cohort_month, month_n;
cohort_month | month_n | cac_per_user | cum_cm_per_user | first_month_above_cac
--------------+---------+--------------+-----------------+-----------------------
2024-01-01 | 1 | 60.00 | 10.50 | 8
2024-01-01 | 2 | 60.00 | 20.37 | 8
2024-01-01 | 3 | 60.00 | 29.61 | 8
2024-01-01 | 4 | 60.00 | 38.22 | 8
2024-01-01 | 5 | 60.00 | 46.10 | 8
2024-01-01 | 6 | 60.00 | 53.24 | 8
2024-01-01 | 7 | 60.00 | 59.64 | 8
2024-01-01 | 8 | 60.00 | 65.31 | 8
2024-01-01 | 9 | 60.00 | 70.25 | 8
2024-01-01 | 12 | 60.00 | 81.17 | 8
2024-11-01 | 1 | 60.00 | 10.50 |
2024-11-01 | 2 | 60.00 | 20.27 |
2024-11-01 | 3 | 60.00 | 29.30 |
2024-11-01 | 4 | 60.00 | 37.59 |
2024-11-01 | 5 | 60.00 | |
2024-11-01 | 6 | 60.00 | |
2024-11-01 | 7 | 60.00 | |
2024-11-01 | 8 | 60.00 | |
2024-11-01 | 9 | 60.00 | |
2024-11-01 | 12 | 60.00 | |
(20 rows)
What each step produces: cohort is one row per acquisition month with its user count and average CAC; months is the numbers 1 to 12; cm is contribution margin by cohort and month number; grid uses CROSS JOIN (every combination of two lists) to give every cohort a row for every month, with zero where nobody paid and an observed flag for months that have fully elapsed; cum is the running total; flagged stamps the payback month on every row. The running total is sum(cm) OVER (PARTITION BY cohort_month ORDER BY month_n): OVER turns sum into a window function that keeps every row but adds up a window of rows, PARTITION BY cohort_month restarts the total for each cohort, and ORDER BY month_n adds months in order so each row carries the total to date. Dividing by users gives per acquired user. The payback column, min(month_n) FILTER (WHERE observed AND cum_cm_per_user > cac_per_user) OVER (PARTITION BY cohort_month), finds the smallest month number meeting the condition within each cohort and repeats it on every row of that cohort.
A three-user example shows the denominator. Three users are acquired in January, each paying $10.50 of contribution a month: user A pays in months 1 to 3, user B in months 1 to 2, user C never pays. Contribution is $21.00 in month 1, $21.00 in month 2 and $10.50 in month 3, so cumulative contribution per acquired user is 21 / 3 = $7.00, then $14.00, then $17.50. Dividing by the 2 payers instead would overstate month 1 as $10.50.
Reading the output: the January 2024 cohort has an average CAC of $60.00 and cumulative contribution per user of $10.50 at month 1 (100 users x ($15.00 - $4.50) / 100), $53.24 at month 6, $59.64 at month 7 and $65.31 at month 8, so payback is month 8, and $81.17 by month 12. The November 2024 cohort is observed only through month 4 ($37.59), and its later cells are NULL because those months have not fully elapsed at the cut-off; its payback month is NULL, meaning "not yet", not "never". The comparison with CAC is strict (greater than). Remove the final WHERE to see every cohort and month, and pivot to 12 columns in the business intelligence (BI) tool if you want a wide table.
Key details: the first-above-CAC window is computed in flagged before the display filter (filtering first would drop every month not on the display list, so a cohort whose payback month is not on the list, such as month 10 or 11, would report a later month or none; with this particular list, which happens to include month 8, January would still show 8, so the order matters in general rather than for this exact output); grid cross joins cohorts to months 1 to 12 so months with no revenue appear as zero rather than disappearing; the denominator is all acquired users, and the comparison is strict (greater than CAC).
Variant: payback in days by marketing channel
When you have spend(channel, spend_date, spend), installs(user_id, channel, installed_at) and a revenue table, compute CAC per channel as spend over installs and find the first day the cumulative contribution per install reaches it. Restrict to installs that have a full 90-day window so late installs do not understate the curve. The script builds two channels (Paid social at $60,000 of spend and Search at $14,000, 400 installs each) and prints one row per channel.
DROP SCHEMA IF EXISTS demo CASCADE;
CREATE SCHEMA demo;
SET search_path = demo;
CREATE TABLE installs (user_id int PRIMARY KEY, channel text, installed_at timestamp);
CREATE TABLE spend (channel text, spend_date date, spend numeric(12,2));
CREATE TABLE revenue (user_id int, revenue_date date, amount numeric(10,2), variable_cost numeric(10,2));
-- 400 installs on each channel across Jan 2025; channel spend of $60,000 (paid_social) and $14,000 (search)
INSERT INTO installs
SELECT g, CASE WHEN g <= 400 THEN 'paid_social' ELSE 'search' END,
timestamp '2025-01-01' + (g % 31) * interval '1 day'
FROM generate_series(1, 800) g;
INSERT INTO spend
SELECT ch, d::date, amt
FROM (VALUES ('paid_social', 60000.00 / 31), ('search', 14000.00 / 31)) v(ch, amt),
generate_series(date '2025-01-01', date '2025-01-31', interval '1 day') d;
-- one $20 purchase with $6.00 variable cost every 10 days after install, for 1 + (id mod 8) purchases; search users buy more often
INSERT INTO revenue
SELECT i.user_id, (i.installed_at + k * (CASE WHEN i.channel = 'search' THEN 7 ELSE 10 END) * interval '1 day')::date, 20.00, 6.00
FROM installs i, generate_series(0, 8) k
WHERE k < 1 + (i.user_id % 8);
WITH params AS (SELECT DATE '2025-06-30' AS as_of, 90 AS window_days),
inst AS (
SELECT i.user_id, i.channel, i.installed_at::date AS d0
FROM installs i CROSS JOIN params p
WHERE i.installed_at::date + p.window_days <= p.as_of -- every install has a full window
),
cac AS (
SELECT i.channel, count(*) AS installs,
(SELECT sum(s.spend) FROM spend s
WHERE s.channel = i.channel
AND s.spend_date BETWEEN min(i.d0) AND max(i.d0)) / count(*) AS cac_per_install
FROM inst i GROUP BY i.channel
),
daily AS (
SELECT i.channel, (r.revenue_date - i.d0) AS day_n, sum(r.amount - r.variable_cost) AS cm
FROM inst i
JOIN revenue r ON r.user_id = i.user_id AND r.revenue_date >= i.d0
CROSS JOIN params p
WHERE r.revenue_date - i.d0 <= p.window_days
GROUP BY 1, 2
),
cum AS (
SELECT d.channel, d.day_n, c.cac_per_install,
sum(d.cm) OVER (PARTITION BY d.channel ORDER BY d.day_n) / c.installs AS cum_cm_per_install
FROM daily d JOIN cac c USING (channel)
)
SELECT channel, round(max(cac_per_install), 2) AS cac_per_install,
min(day_n) FILTER (WHERE cum_cm_per_install >= cac_per_install) AS payback_days,
round(max(cum_cm_per_install), 2) AS cm_per_install_at_90d
FROM cum GROUP BY channel ORDER BY channel;
channel | cac_per_install | payback_days | cm_per_install_at_90d
-------------+-----------------+--------------+-----------------------
paid_social | 150.00 | | 63.00
search | 35.00 | 14 | 63.00
(2 rows)
Search pays back on day 14 against a CAC of $35.00. Paid social has a CAC of $150.00 and reaches only $63.00 per install in 90 days, so its payback is NULL: it does not pay back inside the window. Report that as "more than 90 days", not as a missing value. Spend is summed over the date range of the installs in scope, so the spend and installs cover the same period: Paid social is $60,000 / 400 = $150.00 per install and Search $14,000 / 400 = $35.00. Both channels show $63.00 at 90 days because each has 400 installs whose purchase counts cycle evenly through 1 to 8 (mean 4.5), each purchase contributes $20.00 - $6.00 = $14.00, and every purchase falls inside the 90 days: 4.5 x $14.00 = $63.00. Search differs in speed, not total: it buys every 7 days instead of every 10, so it crosses its CAC on day 14. This query tests >= (reaches CAC) while the monthly one tests > (exceeds it); no value in these outputs lands exactly on its CAC, so the choice changes nothing here, but pick one rule and keep it everywhere.
Trade-offs and pitfalls
- A cohort-level average hides the mix by channel; the daily variant, or adding
channelto the grouping, shows it. - CAC allocated per user is itself an estimate; check that the cohort total equals real spend.
- If revenue can be refunded, include negative amounts or contribution is overstated.
- Recent cohorts always look worse than old ones simply because they have fewer months; compare cohorts at the same month_n only.
Design a cohort-based customer lifetime value model for a product with several tiers. It should reflect different gross margins by tier, expansion revenue and discounting of future cash flows. Walk through the inputs and formulas, then show a short sample calculation for one cohort with 12 months of data and churn that declines over time.
Sample Answer
Direct answer
Model each tier as its own cohort: customers acquired in the same month on the same tier. For every month, multiply the share still active (survival) by that tier's gross profit per active customer (price grown by expansion, times that tier's gross margin (the share of revenue left after the direct cost of serving the customer), minus any one-time onboarding cost), discount that cash to today (its present value, PV), and sum over the horizon. Add the tiers weighted by how many customers each contains. Use a churn rate that is highest early and decays toward a floor (falls month by month toward a minimum level), calibrate it on real cohort retention, and report 12-month discounted LTV per signup alongside a clearly labelled tail beyond month 12.
Terms: cohort is a group of customers who start in the same period; gross margin is revenue minus direct serving cost as a share of revenue; expansion is a retained customer paying more over time (upgrades, extra seats); churn is the share of customers lost each month; discounting converts future dollars into today's dollars at a monthly rate d.
Inputs (per tier t)
| Input | Symbol | Notes |
|---|---|---|
| Customers acquired | N_t | The cohort size on that tier |
| Starting monthly price per customer | A_t | ARPU (average revenue per user) at month 1 |
| Gross margin | g_t | Differs by tier (support and infrastructure cost scale differently) |
| Monthly expansion of ARPU for retained customers | e_t | Zero for a flat-priced tier |
| One-time onboarding cost per customer | O_t | Charged in month 1; makes month-1 margin low or negative |
| Churn at end of month k | c_k | Declines with tenure; here c_k = c_floor + (c_0 - c_floor) x decay^(k-1) |
| Monthly discount rate | d | From finance |
Formulas
Survival (the share of the cohort active in month k): S_1 = 1 and S_k = S_(k-1) x (1 - c_(k-1)). ARPU in month k is A_t x (1 + e_t)^(k-1). Gross profit per active customer is ARPU_k x g_t minus O_t in month 1 only. Cash is received at the start of each month, so month k is discounted by (1 + d)^(k-1).
LTVcohort=∑t∈tiersNt∑k=112(1+d)k−1Sk(At(1+et)k−1gt−Ot1[k=1])
Reading the formula for one tier: the inner sum walks through months 1 to 12. In each month it takes the share still active (S_k), multiplies by the gross profit per active customer, and divides by the discount factor to get the present value (PV) of that month's cash. The symbol 1[k=1] is an indicator: it equals 1 in month 1 and 0 in every other month, so the onboarding cost O_t is subtracted once. The outer sum adds the tiers, each weighted by its customer count N_t.
Sample calculation: one cohort, 12 months
Illustrative cohort of 1,000 customers: Basic 600 customers ($20, 70% margin, no expansion, no onboarding cost), Pro 300 ($60, 80%, 1.5% monthly expansion, $40 onboarding), Business 100 ($200, 85%, 2% expansion, $300 onboarding). Churn starts at 10% and decays toward 3% (decay factor 0.75), and d = 1% a month. For simplicity all tiers share one churn curve, so the table isolates the effect of margin, expansion and onboarding; in practice fit a curve per tier. The Pro rows show the mechanics: month 1 gross profit is 60 x 0.80 - 40 = $8.00 (the onboarding period is near zero margin), then grows as survival falls and ARPU rises.
# Cohort LTV by tier: 12 months, declining churn, expansion, tier margins, onboarding cost, discounting.
d = 0.01 # monthly discount rate; month k cash (billed at start of month) is discounted by (1+d)^-(k-1)
tiers = {
# customers, ARPU $/mo, gross margin, expansion/mo, onboarding $ per customer (month 1)
"Basic": dict(n=600, arpu=20.0, gm=0.70, exp=0.000, onb=0.0),
"Pro": dict(n=300, arpu=60.0, gm=0.80, exp=0.015, onb=40.0),
"Business": dict(n=100, arpu=200.0, gm=0.85, exp=0.020, onb=300.0),
}
def churn(k, c_inf=0.03, c0=0.10, decay=0.75):
"""Churn at the END of month k: starts at c0 and decays toward c_inf."""
return c_inf + (c0 - c_inf) * decay ** (k - 1)
def run(t, verbose=False):
surv, tot_pv, tot_undisc = 1.0, 0.0, 0.0
rows = []
for k in range(1, 13):
arpu_k = t["arpu"] * (1 + t["exp"]) ** (k - 1)
gp = arpu_k * t["gm"] - (t["onb"] if k == 1 else 0.0) # gross profit per ACTIVE customer
df = (1 + d) ** -(k - 1)
pv = t["n"] * surv * gp * df
rows.append((k, surv, arpu_k, gp, df, pv))
tot_pv += pv; tot_undisc += t["n"] * surv * gp
surv *= 1 - churn(k)
return rows, tot_pv, tot_undisc
rows, pv, und = run(tiers["Pro"])
print("Pro tier, 300 customers")
print("month survival ARPU gross profit/cust disc.factor PV of cohort ($)")
for k, s, a, gp, df, p in rows:
print(f"{k:>5} {s:>8.4f} {a:>6.2f} {gp:>16.2f} {df:>10.5f} {p:>12,.0f}")
print(f"Pro: undiscounted ${und:,.0f}, discounted ${pv:,.0f}, per signup ${pv/300:,.2f}")
print("\ntier customers PV 12-mo ($) PV per signup ($) survival after month 12")
grand = 0; n_all = 0
for name, t in tiers.items():
r, p, u = run(t)
grand += p; n_all += t["n"]
s12 = r[-1][1] * (1 - churn(12))
print(f"{name:<9} {t['n']:>9} {p:>12,.0f} {p/t['n']:>17,.2f} {s12:>9.3f}")
print(f"cohort total: ${grand:,.0f} over {n_all} customers = ${grand/n_all:,.2f} per signup")
print("churn path:", [f"{churn(k):.1%}" for k in range(1, 13)])
Pro tier, 300 customers
month survival ARPU gross profit/cust disc.factor PV of cohort ($)
1 1.0000 60.00 8.00 1.00000 2,400
2 0.9000 60.90 48.72 0.99010 13,024
3 0.8257 61.81 49.45 0.98030 12,009
4 0.7685 62.74 50.19 0.97059 11,231
5 0.7227 63.68 50.95 0.96098 10,615
6 0.6850 64.64 51.71 0.95147 10,111
7 0.6531 65.61 52.49 0.94205 9,687
8 0.6254 66.59 53.27 0.93272 9,322
9 0.6008 67.59 54.07 0.92348 9,000
10 0.5785 68.60 54.88 0.91434 8,709
11 0.5581 69.63 55.71 0.90529 8,444
12 0.5392 70.68 56.54 0.89632 8,198
Pro: undiscounted $119,070, discounted $112,750, per signup $375.83
tier customers PV 12-mo ($) PV per signup ($) survival after month 12
Basic 600 67,734 112.89 0.521
Pro 300 112,750 375.83 0.521
Business 100 120,891 1,208.91 0.521
cohort total: $301,375 over 1000 customers = $301.37 per signup
churn path: ['10.0%', '8.2%', '6.9%', '6.0%', '5.2%', '4.7%', '4.2%', '3.9%', '3.7%', '3.5%', '3.4%', '3.3%']
Reading it: Pro's cohort is worth $112,750 discounted over 12 months, $375.83 per signup, versus $119,070 undiscounted. Per signup, Business is worth $1,208.91, Pro $375.83 and Basic $112.89, and the 1,000-customer cohort totals $301,375, or $301.37 per signup. To reconcile the other tiers: the survival-and-discount weights S_k x discount factor sum to 8.0636 over the 12 months. Basic earns a flat 20 x 0.70 = $14.00 per active month, so its PV per signup is 14.00 x 8.0636 = $112.89, and 600 customers give $67,734. Business month 1 is 200 x 0.85 - 300 = -$130.00; month 2 is 200 x 1.02 x 0.85 = $173.40 per active customer, which at survival 0.9 and discount factor 0.9901 is $154.51 per signup; summing all 12 months gives $1,208.91 per signup and $120,891 for the 100 customers. Compare each figure against the CAC of that tier. About 52% of customers are still active at the start of month 13 (the survival-after-month-12 column; the Pro table's month 12 row, 0.5392, is the share active during month 12), so a 12-month figure understates lifetime value; add a tail using the floor churn: tail value per active customer = month-13 gross profit / (1 - (1 - c_floor)(1 + e)/(1 + d)), valid only when the denominator is positive, and shown separately. For Pro: month-13 gross profit per active customer is 60 x 1.015^12 x 0.80 = $57.39, and (1 - 0.03) x 1.015 / 1.01 = 0.9748, so the denominator is 0.0252 and the value of all later months is 57.39 / 0.0252, about $2,278 per active customer as of month 13. Multiply by the 52.1% still active and discount back 12 months (divide by 1.01^12 = 1.1268): about $1,054 per Pro signup, against $375.83 inside the first 12 months. The gap shows how much a 12-month figure leaves out and how assumption-driven the tail is; using the 3% floor slightly overstates it, since month-13 churn is still about 3.2%.
Calibrating the churn curve
- Build observed retention by tenure month for each tier from past cohorts, using a survival estimator (a method for estimating retention when some customers are still being observed; Kaplan-Meier is the standard one, and it counts a customer as at risk only for the months actually observed, then drops them from the denominator, rather than treating them as churned) so cohorts that have not yet reached month k are not counted as churned.
- Fit the decay form (c_0, c_floor, decay) by least squares on survival (choose the values that make the squared gaps between predicted and observed survival as small as possible), holding out the newest cohorts (leave them out of the fit, then check the fitted curve against them).
- Compare predicted with actual survival at months 3, 6 and 12; if the fit is poor, use the empirical hazard (the observed share of still-active customers who leave in each tenure month) directly for months you have data and the fitted form only for the tail.
- Re-fit as cohorts mature, and keep upgrades and downgrades between tiers in the expansion term, not in churn.
Trade-offs and pitfalls
- One churn curve for all tiers hides that cheap tiers usually churn faster; fit them separately.
- Expansion and churn interact: if survivors expand strongly, an undiscounted infinite sum can diverge, so always cap the horizon or discount.
- Onboarding cost belongs in the cohort that incurred it, not spread across all months.
- Do not let one big enterprise account drive the Business tier curve: show it with and without the largest account.
Unlock Full Question Bank
Get access to all Business Metrics and Unit Economics interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.