Sub topic 9
Retention fundamentals
Retention measures whether users who started using a product are still using it later. Activation asks whether a new user reached value. Engagement asks how much active users do. Retention asks whether they come back after the first experience. This chapter assumes you can write basic SQL (SELECT, JOIN, GROUP BY) and that you know how to define a metric by population, event, and time window. The next chapter builds on it with cohort tables and retention curves.
What retention measures
A retention rate is a ratio with the same three parts as any precise metric:
- Population (denominator): the users you started with, usually everyone who signed up or activated in a given period.
- Return event: the action that counts as "still using the product".
- Time window: when, relative to each user's own start, the return event must happen.
The rate is the number of users from the population who performed the return event in the window, divided by the size of the population.
Suppose 1,000 users signed up in the week of 5 January. 400 of them performed the core action on their seventh day after signup. Day-7 retention for that group is 400 / 1,000 = 40%.
Retention is measured per user, relative to that user's own start date. It is not measured against the calendar. A user who signed up on 2 January is checked on 9 January. A user who signed up on 20 January is checked on 27 January. Aligning users by their own start is what makes a cohort comparable. The next chapter covers cohorts in detail.
Choosing the return event
The return event decides what retention means. There are two common choices, with different trade-offs.
| Return event | What it tells you | Risk |
|---|---|---|
| Any event (a login, an app open) | The user showed up | Background activity, notifications, and automatic syncs inflate the number |
| A core action (sending a message, creating a project) | The user got value again | Needs a well-chosen definition, and a poor choice hides real use |
Prefer a core action tied to the value the product delivers. For a note-taking app, "opened the app" is weak evidence of retention. "Created or edited a note" is much stronger. Write the event down as part of the metric definition. If two teams use different return events, they will report different retention figures and both will be correct.
Choosing the starting point
The denominator needs equal care. You can start the clock at signup, at activation, or at first purchase.
- Signup-based retention includes everyone who ever registered. It is lower, because users who never activated cannot be retained.
- Activation-based retention includes only users who reached the aha moment. It isolates how well the product keeps users who have already seen its value.
Both are legitimate, but they answer different questions. A low signup-based figure with a healthy activation-based figure points to an onboarding problem, not a product-value problem. Keep the two apart in reports.
Types of retention
The time window can be defined in three ways. The retention curves chapter covers them in depth. You need the outline now because they change the number you compute.
| Type | Counts a user as retained if they... | Typical use |
|---|---|---|
| N-day (classic) | Were active on exactly day N after start | Products with daily use, such as games or messaging |
| Bracket | Were active at any point within a range, such as days 7 to 13 | Products with weekly or irregular use |
| Unbounded | Were active on day N or any later day | Products where the long-term return matters more than timing |
For the same users, unbounded retention is never lower than bracket retention, and bracket is never lower than the matching single-day figure. When someone quotes "day-30 retention" without naming the type, ask which one they mean.
Computing day-7 retention
The query below computes N-day (classic) retention for January 2026 signups, with N = 7. The window for each user is the 24 hours that begin exactly 7 days after their own signup. It also excludes users whose day-7 window has not completed yet, a point explained in the next section.
-- Day-7 retention for users who signed up in January 2026
-- Assumes: users(user_id, signup_at), events(user_id, event_name, event_time)
WITH params AS (
SELECT TIMESTAMP '2026-02-15 00:00:00' AS data_through
)
SELECT
COUNT(DISTINCT r.user_id) * 1.0 / COUNT(DISTINCT u.user_id) AS day7_retention,
COUNT(DISTINCT u.user_id) AS cohort_size
FROM users u
CROSS JOIN params p
LEFT JOIN events r
ON r.user_id = u.user_id
AND r.event_name = 'core_action'
AND r.event_time >= u.signup_at + INTERVAL '7 days'
AND r.event_time < u.signup_at + INTERVAL '8 days'
WHERE u.signup_at >= DATE '2026-01-01'
AND u.signup_at < DATE '2026-02-01'
AND u.signup_at + INTERVAL '8 days' <= p.data_through;Three details matter here.
- The
LEFT JOINkeeps users with no return event in the denominator. AnINNER JOINwould drop them and report 100% retention. - Counting
DISTINCTusers stops a user with many events in the window from being counted more than once. - The window is relative to
u.signup_at, so each user is judged on their own day 7.
Immature data
A user who signed up three days ago cannot yet have a day-7 result. If you include them in the denominator, they count as "not retained" only because the data has not arrived. This is right-censoring: the outcome is not observable yet. The result is a retention figure that looks like it is falling in the most recent cohorts when nothing has changed.
The data_through filter in the query above removes users whose window is still open. Apply the same rule to any retention report. Show only cohorts whose window is complete, or mark the incomplete ones clearly.
Retention versus engagement
Retention and engagement are related but not the same. A product can retain many users who each use it rarely, as with a tax filing tool that people return to once a year. Another product can have a small group of users who are very active every day, with poor retention among everyone else. Stickiness (DAU divided by MAU) summarizes how often active users show up. Retention tells you whether the people you acquired remain active. You need both to understand the product.
Common errors
- Using "any event" as the return event. Notification opens and background syncs make retention look better than real use.
- Mixing populations. Comparing signup-based retention from one report with activation-based retention from another produces an apparent change that is only a change of definition.
- Averaging across ages. A single "retention rate" that blends day-1 and day-30 users hides the shape of the decline.
- Ignoring survivors. Retained users are not a random sample of everyone who tried the product. Describing "our users" using only the retained ones overstates how well the product works for new arrivals.
- Treating the timezone as irrelevant. A day boundary in UTC differs from a day boundary in the user's local time. Pick one convention and keep it.
Exercise
A team reports that day-7 retention for users who signed up in the last 10 days is 22%, compared with 38% for the month before. The query includes all signups, and the data runs up to today. Name two things to check before concluding that retention fell, and say how you would fix the query.
Show answer
First, check whether the recent cohort is immature. Users who signed up fewer than 8 days ago have not finished their day-7 window, so they count as not retained only because the data is incomplete. Second, check that the return event and population match those used for the earlier month, since a changed definition would also shift the number. Fix the query by excluding users whose signupat plus 8 days is later than the data cutoff, as the datathrough filter does, and by keeping the return event and starting point identical for both periods.