Trimtab

Blog / Measuring in PostHog and Stripe

How to measure retention in PostHog: cohorts, curves and pitfalls

Measure retention as the share of a signup cohort that repeats your value event in later weeks. How to set it up in PostHog, read the curve and avoid the usual traps.

To measure retention, group users into cohorts by the week they signed up, then track what share of each cohort performs your value event in each following week. In PostHog that is a Retention insight with signup as the start event, the value event as the return event and a weekly period. The number to watch is where the curve flattens: the share of a cohort that is still there once the early drop-off is over. This guide covers the three choices to make before you build the insight, the settings that change the result, how to read the curve, and how to match it with revenue retention in Stripe.

What retention measures, and what it does not

Retention follows a cohort forward in time. Everyone in the January 5 cohort signed up that week; week 1 shows the share who came back the following week, week 2 the week after, and so on. Week 0 is always 100 percent, because every member of the cohort performed the start event.

Three related numbers answer different questions:

  • Churn takes all customers at the start of a period and counts who cancelled. It is a billing number, covered in the SaaS churn rate guide.
  • Stickiness, in PostHog's words, shows "how many times users perform an event within a specific time period." Retention only says whether someone came back, not how often. The retention docs send you to stickiness for frequency.
  • Net revenue retention follows money rather than people, and can exceed 100 percent through upgrades. See the net revenue retention guide.

Usage retention comes first in time. A team that stops using your product in week 6 will often cancel at the next renewal, and the drop shows in PostHog well before it reaches Stripe.

Three choices to make before you open PostHog

1. Who enters the cohort

The start event defines the cohort. For a SaaS, it is usually the signup or the account creation event. If you sell to companies, decide whether you measure users or accounts: PostHog's Retention insight can aggregate by groups such as companies, which requires group analytics. A collaborative tool where one person stays active for a team of five looks very different at the account level.

Keep free users and paying customers apart. Olga Berezovsky, in her guide to cohort retention for Lenny's Newsletter, warns that blended retention hides free-user activity and the conversion opportunity behind it.

2. What counts as coming back

The return event is the decision that matters most. The same guide recommends defining "active" by the main user action rather than logins, app opens or visits, which are noisier. A login says the person opened the app; the value event says they got what they came for. In an invoicing tool, that is an invoice sent. In an analytics tool, a report viewed. If your tracking plan does not have that event yet, add it before you measure anything.

3. Which period

Pick the period that matches how often your product is supposed to be used. A daily habit app needs daily retention; a payroll tool used once a month needs monthly retention. Measured on the wrong period, a perfectly healthy monthly product looks like it loses most users every week. PostHog's lifecycle docs give a symptom of a bad fit: many users flagged as resurrecting can mean the interval does not match the product's natural usage frequency, such as weekly users viewed daily. For most B2B SaaS, weekly is the place to start.

How to build the Retention insight in PostHog

  1. Create a new insight and choose Retention. The insight takes a start event and a return event. Both can be events or actions, and they do not have to be the same.
  2. Set the start event to signup and choose first time retention. The docs describe three retention types. First time counts a user only the first time they performed the start event within the date range. Recurring counts a user in any period where they performed the start event, first time or not. First ever occurrence checks the first occurrence across all time. For signup cohorts, first time is the one you want.
  3. Set the return event to your value event. Not the login, for the reasons above.
  4. Choose the period and the range. Retention periods can be hours, days, weeks or months. Eight to twelve weekly cohorts give you enough history to see a trend without mixing in a product from a year ago.
  5. Leave the calculation options on their defaults first, then change them on purpose (next section).
  6. Add filters and breakdowns once the overall curve is clear. Filters accept event properties, person properties, feature flags and cohorts. Breakdowns split the result by a property, a cohort or a SQL expression.

The settings that change your number

The same data can produce very different curves depending on three options in the Retention docs.

OptionDefaultAlternativeWhen to switch
Returning time criteriaOn: counted only if they returned in that exact periodOn or after: counted if they returned in that period or any later oneIrregular usage, or when you want a number close to the inverse of churn
Retention referencePeriod 0: percent of the initial cohortPrevious period: percent of last period's returning usersTo find the biggest drop between two periods
Mean calculationWeighted: larger cohorts weigh moreSimple: every cohort weighs the sameWhen one launch week brought an unusual cohort

On or after, also called rolling or unbounded retention, always reads higher than On, because a user who returns in week 5 also counts in weeks 1 to 4. Berezovsky calls the bounded version the most conservative method and suggests it when your KPIs are tied to fixed windows, which is often the case in SaaS. Whatever you choose, write it next to the chart. A retention number quoted without its mode cannot be compared with anything.

How to read the curve

Look for the flattening. Every curve drops after week 0. What matters is whether it levels off, and at what height. A curve that settles at 30 percent from week 6 means you keep about a third of signups for good; a curve still sliding at week 12 means you have not found the users who stay.

Compare cohorts, not averages. The cohort table puts each signup week on its own row. If the March cohorts flatten higher than the January ones, something you changed in between worked. An average across cohorts hides exactly that.

Ignore the last cells. PostHog marks periods still in progress, and they update as data arrives. The latest cohorts always look worse than they are.

Expect bumps in On mode. A user can count in several later periods, so a later period can show higher retention than an earlier one. The docs read this as a sign of regular return patterns, such as a monthly task.

Click a cell. It opens the list of retained users for that period. Combined with session replay, it shows what the users who stayed did differently.

Use cohorts to find who stays

A retention curve tells you how many stay. Cohorts tell you who. In PostHog, cohorts are lists of users with something in common, either dynamic (rule-based, updated once every 24 hours) or static (a fixed list).

Three cohorts are worth building in most SaaS:

  1. Users who performed the value event at least three times in their first week. Compare their retention with everyone else's, using the cohort as a breakdown.
  2. Users who invited a teammate. In a collaborative product, a second user is often what separates accounts that stay.
  3. Users who signed up through each main channel. A channel that brings cheap signups who never return costs more than it looks.

You can also save a cohort from an insight: click a data point, see the persons, and choose "Save as cohort." Cohorts rely on person properties and identified events, and they cannot be built on groups yet, so account-level analysis goes through the Retention insight's groups option.

A gap between two cohorts is a correlation, not proof. Users who invite a teammate may stay because they were more committed from the start. Treat the gap as a hypothesis to test, then size it as you would any growth bet.

Stickiness and lifecycle: the two complements

Once retention is in place, two other PostHog insights fill its gaps.

Stickiness counts users by how many times they performed an event within a period. A product used every day by a small group and once a week by everyone else gets the same retention number for both groups; stickiness separates them.

Lifecycle splits active users into new, returning and resurrecting, and shows dormant users below the zero line. In PostHog's definitions, returning users were active in the previous interval and the current one, resurrecting users were inactive in the previous interval and came back, and dormant users were active before but not now. Anonymous events are excluded. It answers whether this week's active users come from new signups or from the existing base.

Revenue retention in Stripe

PostHog measures usage. For money, the Stripe Billing overview has a retention by cohort view, described in the analytics docs. Stripe assigns each subscriber to the cohort of the month they first started generating positive MRR, and shows two tables:

  • Subscriber retention: the number of active subscribers from the cohort still there at the end of each later month.
  • Revenue retention: the MRR remaining from the cohort, which includes expansion and can exceed 100 percent.

Stripe's own example shows how fast a constant rate compounds: with 10 percent monthly subscriber churn, a cohort keeps 90 percent after one month, 81 after two and 59 after five. If you need a different convention, the "Subscription metrics per month" report exports retention by month, and Stripe Sigma lets you rebuild it in SQL.

Read both sides together. When usage retention drops in PostHog and revenue retention holds in Stripe, you are looking at customers who still pay but no longer use the product: the cancellations are coming.

The usual pitfalls

  1. Login as the return event. It inflates retention with people who opened the app and left. Use the value event.
  2. Free and paying users in one cohort. Free users dilute the curve and hide what paying customers do. Filter or break down by plan.
  3. Recurring retention on signup cohorts. Use first time, or a user who triggers the start event again will appear in several cohorts.
  4. On or after compared with On. The two modes answer different questions. Compare like with like, including with your own past numbers.
  5. Tiny cohorts. A cohort of twelve signups moves 8 points when one person leaves. Use monthly cohorts or wider date ranges until weekly cohorts reach a size you trust.
  6. Benchmarks with another denominator. Lenny Rachitsky's retention benchmarks (June 2020, a synthesis from about twenty growth operators plus public company data) put six-month retention at around 60 percent for good and 80 percent for great in SMB and mid-market SaaS. For SaaS, the denominator there is companies that started a paid subscription. Comparing it with all your free signups will make you look worse than you are. More reference points, each with its sample, are in the SaaS benchmarks guide.

What to remember

Retention is the share of a cohort that comes back to do the thing your product exists for. In PostHog, build a Retention insight with signup as the first time start event, the value event as the return event, and the period your product is meant to be used on. Leave the defaults on until you know why you would change them, and write the mode next to the number. Read where the curve flattens, compare cohorts row by row, and match it with Stripe's revenue retention by cohort. Then pick the one cohort difference worth testing this week, and measure the curve again a month later.

Frequently asked questions

What is a good user retention rate for a B2B SaaS?

Lenny Rachitsky's 2020 synthesis of about twenty growth operators puts six-month retention for SMB and mid-market SaaS at around 60 percent for good and 80 percent for great, and 70 and 90 percent for enterprise. The denominator there is companies that started a paid subscription, so compare it with a paying-customer cohort, not with all signups.

What is the difference between first time and recurring retention in PostHog?

With first time retention, PostHog puts a user in a cohort only the first time they perform the start event within the insight's date range, which is what you want for signup cohorts. Recurring retention counts a user in the cohort of any period where they performed the start event, first time or not. A third option checks the first occurrence across all time.

Should I use On or On or after retention?

Use On, the PostHog default, when your product is meant to be used every period, such as a tool people open every week. Use On or after, also called rolling or unbounded retention, when usage is irregular. It counts a user as retained in a period if they came back then or later, so it reads higher and behaves roughly as the inverse of churn.

What is the difference between retention and churn?

Retention follows a cohort forward and asks what share is still active in each later period, usually measured on product usage. Churn takes all customers at the start of a period and asks what share cancelled, usually measured on billing. A usage retention curve tends to drop weeks before the cancellation shows up as churn in Stripe.

Sources

  1. PostHog docs, Retention: https://posthog.com/docs/product-analytics/retention
  2. PostHog docs, Stickiness: https://posthog.com/docs/product-analytics/stickiness
  3. PostHog docs, Lifecycle: https://posthog.com/docs/product-analytics/lifecycle
  4. PostHog docs, Cohorts: https://posthog.com/docs/data/cohorts
  5. Stripe docs, Billing analytics (retention by cohort, subscriber churn rate): https://docs.stripe.com/billing/subscriptions/analytics
  6. Olga Berezovsky in Lenny's Newsletter, How to measure cohort retention (August 2022): https://www.lennysnewsletter.com/p/measuring-cohort-retention
  7. Lenny Rachitsky, What is good retention (June 2020): https://www.lennysnewsletter.com/p/what-is-good-retention-issue-29
Colas VandervaereHead of Growth, building Trimtab

Read next