Retention Cohorts
The matrix that answers 'do users come back' with colors instead of arguments
The retention cohort matrix has cohorts in rows, periods-since-entry in columns, and percent-active cells. Reading it diagnosizes product health better than any single number.
What you will learn
- Build a period retention matrix from raw events
- Draw the correct conclusion from cohort-row shapes and column trends
- Debate what counts as 'active' and keep it comparable
In a retention matrix, each cell is 'percent of a cohort active in period k since entry' (usually period 0 = 100% by definition). Rows show the lifecycle; columns show vintage trend.
What is this?
A retention cohort matrix is a table where rows are acquisition cohorts (e.g. signup months), columns are periods-since-entry (Month 0, 1, 2, …), and cells hold the percentage of the cohort that was active in that period. Month 0 is usually 100% by definition (everyone who signed up was active that month). Reading down a column shows whether newer cohorts are more retentive than older ones; reading across a row shows how the cohort's engagement naturally decays.
Why do you need it?
- A single aggregate retention number can't tell 'new users worse' from 'everyone decays faster' — the matrix separates them.
- It makes product launches checkable: release in July, July's row should flatten sooner.
- Row shapes reveal the decay curve (fast attrition vs mild slope) suggesting different fixes.
- Columns surface seasonal effects while reducing calendar noise per cohort.
Mental model
A school's class attendance sheet
The retention matrix
Each year's intake has its own attendance trend; the headmaster compares 'same grade, different years' to spot whether this year's class is drifting from school earlier. Rows are classes, columns are grade levels.
How it works
- Select the entry event, the active-event definition, and the period (day/week/month).
- Compute for each cohort and each period k the share unique-active / cohort_size (k=0 → 100%).
- Present as a matrix and/or plotted row-by-row as retention curves.
- Compare row shapes and column trends; benchmark decay curve against category norms.
- Drill into underperforming cohorts to distinguish product regressions from acquisition quality issues.
Layout of the standard retention matrix.
In production
- A job board sees its M0→M1 column drop 20 points for cohorts starting in April when a competitor launched — a market event caught in the matrix.
- A productivity app's June cohort (post-onboarding-redesign) flattens its decay curve: 12% higher M3 retention than May's row — the change is validated.
- A content site uses the matrix as its weekly health check, paging the product lead when any recent cohort dips below its 90-day band.
Best practices
- Define 'active' exactly (event list + dedupe key) and freeze it for matrix comparability.
- Show cohort counts alongside percentages so thin cohorts don't mislead.
- Use period length deliberately: daily for sticky consumer apps, weekly/monthly for B2B.
- Benchmark the row shape, not just M1: the flattening point (knee) is where retention stabilizes.
Common mistakes
- Filling M0 with all signups including users who never actually started using — M0 should be 'active in their first period', often ~signup-or-worse.
- Comparing cohorts with different period lengths.
- Including perpetually-bounded cells (like M3 of a 2-month-old cohort) in trend reads.
- Switching the active definition mid-period and 'discovering' a product win that's actually a metric change.
Debugging tips
- A dropped cohort row appearing across ALL cohorts means an active-definition change, not a cohort problem.
- Check cohort sizes before diagnosing shape; a 30-user cohort row has huge sampling noise.
- Reconcile with the raw events table by hand-recomputing one cell for a known cohort.
- Holidays and internal launches must be annotated on the matrix; otherwise analysts can't reconstruct why a vintage deviated.
Interview checkpoint
Hands-on lab
- Generate a realistic signup-and-session event dataset
- Tag users with signup-month cohorts
- Compute and pivot a cohort retention matrix
- Read the matrix for trend and decay conclusions
Build a Cohort Retention Matrix in Pandas
35 min · intermediate
Quick quiz
In a retention matrix, the value at (Cohort=January, Column=M1) is:
Reading down a matrix column compares cohorts at the same age.