Files
supermarket/internal/web/templates/metrics-clv.html
davidandClaude Opus 5.5 152c14b580 Phase 4 part 6: the dashboard, CSV exports and an open metrics page
The MRR page adds churn, CLV, CAC and CLV:CAC. Eight tables download as
CSV (MRR, NRR and revenue cohorts, CAC by month and channel, spend,
products, customers). Metrics → Publish builds an open metrics page from
chosen totals only (never a customer) and opens a pull request that adds
or updates it on the site, checked with a Hugo build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:28:50 -07:00

39 lines
3.1 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{define "content"}}{{with .Data}}{{$d := .}}
<div class="heading"><h1>CLV and cohorts</h1></div>
<p class="lede">What a customer is worth over their life with you, and what each signup cohort has actually paid. CLV is a projection from today's numbers; the cohort table is money that came in, net of refunds and credits.</p>
{{with .CLV}}
<section class="card">
<h2>Customer lifetime value <span class="muted small">measured on {{.Month}}</span></h2>
<div class="funnel">
<div class="step"><span class="label">CLV</span><strong>{{cents .Value}}</strong><span class="rate">gross profit per customer</span></div>
<div class="step"><span class="label">CAC, 12 months</span><strong>{{cents .CAC}}</strong></div>
<div class="step"><span class="label">CLV : CAC</span><strong>{{if ge .Ratio 0.0}}{{dec1f .Ratio}} : 1{{else}}·{{end}}</strong><span class="rate">3 : 1 or more is healthy</span></div>
<div class="step"><span class="label">Average per customer</span><strong>{{usd .ARPA}}</strong><span class="rate">a month</span></div>
<div class="step"><span class="label">Gross margin</span><strong>{{dec1f .Margin}}%</strong><span class="rate">weighted by product</span></div>
<div class="step"><span class="label">Churn</span><strong>{{dec1f .Churn}}%</strong><span class="rate">of customers a month, {{.ChurnMonths}}-month average</span></div>
<div class="step"><span class="label">Lifetime</span><strong>{{if .Lifetime}}{{dec1f .Lifetime}}{{else}}·{{end}}</strong><span class="rate">months, on average</span></div>
</div>
<p class="small muted">CLV = average MRR per customer × gross margin ÷ monthly churn. The margin weighs each product's margin (set on <a href="/metrics#margins">MRR and NRR</a>) by what it billed over 12 months. CAC is the spend logged over the same 12 months ÷ the new customers in them{{if lt .CAC 0.0}}: <a href="/metrics/spend">log your spend</a> to see it{{end}}.</p>
</section>
{{else}}
<section class="card empty"><p>CLV needs at least two complete months of billing from Stripe.</p></section>
{{end}}
{{if .Cohorts}}
<h2>Revenue by cohort</h2>
<p class="help">Customers by the month they first paid, and what they've paid since, per customer, cumulative: invoices paid, less refunds and credits. Month 0 is the month they first paid.</p>
<nav class="tabs">
<a href="/metrics/clv" {{if not .Profit}}aria-current="page"{{end}}>Revenue</a>
<a href="/metrics/clv?view=profit" {{if .Profit}}aria-current="page"{{end}}>Gross profit</a>
</nav>
<div class="table-wrap"><table class="list compact cohorts">
<thead><tr><th>First paid</th><th class="num">Customers</th>{{range $i, $_ := .Span}}<th class="num">{{$i}}</th>{{end}}</tr></thead>
<tbody>{{range .Cohorts}}<tr><td>{{.Month}}</td><td class="num">{{.Customers}}</td>
{{if $d.Profit}}{{range .Margin}}<td class="num">{{if .Known}}{{usd .V}}{{end}}</td>{{end}}{{else}}{{range .PerCustomer}}<td class="num">{{if .Known}}{{usd .V}}{{end}}</td>{{end}}{{end}}
</tr>{{end}}</tbody>
</table></div>
<p class="small"><a href="/metrics/export/cohort-revenue.csv">Download as CSV</a> (every cohort, 24 months)</p>
{{end}}
{{end}}{{end}}