SaaS analytics: MRR, churn, behavioral scoring, Monte Carlo, interventions, Stripe/PayPal. Use when building subscription analytics, revenue projections, or admin dashboards.
SaaS analytics: MRR, churn, behavioral scoring, Monte Carlo, interventions, Stripe/PayPal. Use when building subscription analytics, revenue projections, or admin dashboards.
SaaS Customer Analytics
Core Insight: Revenue is a lagging indicator. Behavior is the leading one.
By the time MRR drops, the subscriber already disengaged weeks ago.
Build systems that detect behavioral decay, not just billing events.
NEVER calculate financial metrics from mutable state. Subscription tables track current status. Payment event ledgers track what happened. For fee calculations, revenue attribution, and audit trails — always query the immutable ledger.
Upgrade from heuristics to principled, calibrated, uncertainty-aware models. These 8 methods are ranked by EV and natural fit — implement top-to-bottom.
#
Method
Replaces
Key Artifact
1
Survival Analysis (Kaplan-Meier + Cox PH)
Naive churn rate
Calibrated survival curves, hazard ratios, LTV via ∫S(t)dt
2
Bayesian Conjugate Updating (Beta-Binomial)
Point estimate churn rates
Posterior with credible intervals, automatic uncertainty
3
Empirical Bayes / Shrinkage
Noisy small-cohort estimates
Shrunk estimates that are provably better (James-Stein)
4
Sequential Testing (SPRT / e-values)
Z-score anomaly detection
Anytime-valid change detection with formal error guarantees
5
CVaR / EVT
P10 from Monte Carlo
Expected revenue in worst 10% of outcomes (tail severity)
6
Renewal Theory
Naive is_active × price
Effective MRR accounting for payment failure/retry dynamics
7
Hidden Markov Models
2x threshold regime detection
Posterior probability of business regime (Growth/Plateau/Decline/Crisis)
8
Multi-Armed Bandits (Thompson Sampling)
Static intervention rules
Adaptive intervention selection that learns which action works for which segment
ATE, NNT, ROI per intervention with confounding control
11
Influence Functions
Equal-weight customer treatment
Concentration risk dashboard, Herfindahl Index
12
Convex Budget Allocation
Sort-by-churn-probability
Revenue-weighted optimal targeting with shadow prices
13
BOCPD (Bayesian Changepoint)
2x threshold rule
Posterior probability of change at each timestep
14
Bifurcation Analysis
Linear break-even
Tipping point identification, early warning signals
15
Hawkes Processes
Independent churn assumption
Contagion-aware churn with branching ratio monitoring
16
Optimal Experimental Design
Equal-split A/B tests
D-optimal allocation, sequential sample sizing
Fallback principle: Every advanced method must degrade to the simpler baseline when data is insufficient. Bayesian posteriors widen to priors. Survival curves fall back to naive rates. SPRT falls back to Z-score.
Full methodology (16 methods), composition diagram, proof obligations, and fallback tables:ADVANCED-MODELING.md
12. Visualization & Dashboard UX
Every metric needs 5 layers: NUMBER → COMPARISON (▲ 8.1%) → SHAPE (sparkline) → WHY (decomposition) → SO WHAT (action). Most dashboards stop at layer 2.
Library stack: Recharts + Tremor + Nivo + Framer Motion. Add D3/Visx only for bespoke.
Chart Type Rules
Metric
Chart
Never Use
Revenue over time
Filled area
Bar (too discrete)
Monte Carlo P10/P50/P90
Fan chart (3-band)
Single line (false precision)
Cohort retention
Heatmap
Line per cohort (spaghetti)
Health distribution
Horizontal stacked bar
Pie (too many segments)
Survival curve
Step function
Smooth line (implies interpolation)
The KPI Card: Value (28-32px) → Trend (emerald ▲ / rose ▼) → Sparkline (30d, no axes). Invert color for "down is good" metrics. Click → detail page.
Color: emerald=growth, rose=decline, amber=warning. Never color alone — always pair with icon/label (8% of men are red-green color blind).
Full library guide, cognitive principles, layout patterns, a11y, responsive, anti-patterns:VISUALIZATION.md
13. Agent-Optimized Interfaces (Robot Mode)
Every metric visible to humans MUST be available via structured JSON. Design both human and agent interfaces as first-class from day one.
CLI: your-cli analytics summary --json
~500 tokens: full business state + pre-computed signals[] + next_actions[] with exact follow-up commands. Agents don't compute thresholds — the system pre-digests intelligence.
Diff: your-cli analytics diff --json --since 24h
Token-efficient delta. Each change has significance field (normal/notable/anomaly) pre-computed via Z-score.