Sub topic 3
Defining a Metric Precisely: Population, Event, and Time Window
This chapter assumes you know what an event and a user ID are (covered in the previous chapter) and can read basic SQL with SELECT, JOIN, and GROUP BY. It also assumes you are comfortable with ratios and percentages.
Why a name is not a definition
"Activation rate" sounds like one number. In practice, two analysts can both report it and get 22% and 41% from the same data. Neither is wrong. They answered different questions without saying so.
A metric name is a label. A definition is a set of choices that makes the number reproducible. Every rate-style product metric needs three choices:
- Population: which users are counted, and which are in the denominator.
- Event: which action counts as "success" for a user.
- Time window: when the event must happen, and relative to what.
If any of the three is missing, the metric is ambiguous. Two people will fill the gap differently, and a dashboard will quietly change meaning when someone edits a query.
The three parts in detail
Population
The population decides who is eligible to be counted. It has two sides.
The denominator population is everyone who could have succeeded. For activation, this is usually "users who signed up in a given period." For engagement, it may be "all users who have ever signed up" or "users who were active at least once in the last 90 days."
The numerator population is the subset of the denominator who did the event. A common bug is a numerator that includes users who are not in the denominator. For example, counting activations in January from users who signed up in December inflates the rate.
Population choices to state explicitly:
- Signup period (for example, signed up in January 2026).
- Account type (free, trial, paid, internal test accounts).
- Platform or region, if the metric is scoped.
- Exclusions, such as employees, bots, and deleted accounts.
Event
The event is the observable action that stands for "success." Choose one that is specific and tied to value, not one that is merely easy to log.
| Candidate event | Problem | Better choice |
|---|---|---|
| `app_opened` | Fires on push notification taps and background refreshes | `project_created` |
| `page_view` | Counts accidental visits | `report_exported` |
| `signup_completed` | Measures acquisition, not value | `first_invite_sent` |
State the event by its exact name in your tracking plan, and note any property filters (for example, event_name = 'project_created' and is_template = false).
Time window
The time window has two parts: an anchor and a length.
- The anchor is the moment the clock starts. For per-user metrics it is usually that user's own signup time. For calendar metrics, it is a fixed date range.
- The length is how long the user has to act, such as 7 days.
The distinction between a per-user window and a calendar window matters a lot. "Users who created a project in January" is a calendar window. "Users who created a project within 7 days of their own signup" is a per-user window. They measure different things, and only the second is fair to users who signed up late in the month.
A worked example: 7-day activation rate
Here is a complete definition:
> Of users who signed up between 2026-01-01 and 2026-01-31, the percentage who performed project_created within 7 days of their own signup.
Each part is visible: population (January signups), event (project_created), window (7 days from each user's signup). The SQL maps to the definition line by line.
-- 7-day activation rate for users who signed up in January 2026
-- Assumes: users(user_id, signup_at), events(user_id, event_name, event_time)
SELECT
COUNT(DISTINCT a.user_id) * 1.0 / COUNT(DISTINCT u.user_id) AS activation_rate_7d
FROM users u
LEFT JOIN events a
ON a.user_id = u.user_id
AND a.event_name = 'project_created'
AND a.event_time >= u.signup_at
AND a.event_time < u.signup_at + INTERVAL '7 days'
WHERE u.signup_at >= DATE '2026-01-01'
AND u.signup_at < DATE '2026-02-01';Read it against the three parts:
- The
WHEREclause onuserssets the population. It also forms the denominator throughCOUNT(DISTINCT u.user_id). - The
a.event_name = 'project_created'condition sets the event. - The two
event_timeconditions set the window, anchored tou.signup_at.
The filters on the event and window sit in the ON clause, not in WHERE. This is deliberate and a frequent source of errors, covered below.
Common errors
Filtering the outer join away
If you move the event filters into WHERE, the LEFT JOIN behaves like an inner join. Users with no matching event drop out of the denominator, and the rate approaches 100%.
-- WRONG: the WHERE clause removes users who never activated
SELECT
COUNT(DISTINCT a.user_id) * 1.0 / COUNT(DISTINCT u.user_id) AS activation_rate_7d
FROM users u
LEFT JOIN events a ON a.user_id = u.user_id
WHERE u.signup_at >= DATE '2026-01-01'
AND u.signup_at < DATE '2026-02-01'
AND a.event_name = 'project_created'
AND a.event_time < u.signup_at + INTERVAL '7 days';Here every remaining row has a matching event, so numerator and denominator are the same set, and the result is 1.0.
Immature users
A user who signed up on January 30 has had only a few days to activate by the time you run the query on February 3. A 7-day rate that includes them is biased downward. Two fixes work:
- Only include users whose full window has elapsed, that is,
signup_at + INTERVAL '7 days' <= now(). - Report the metric only after the last user in the population has completed the window.
Unstated boundaries
Whether the window is < or <=, and whether it uses calendar days or 24-hour blocks, changes the number slightly. "Within 7 days" can mean 168 hours from signup, or through the end of the seventh calendar day. Pick one and write it down. Also fix the time zone, since a signup at 23:30 UTC may be the next day in another zone.
Counting events instead of users
COUNT(*) counts events, so one enthusiastic user creating twelve projects counts twelve times. For a user-level rate, use COUNT(DISTINCT user_id).
Identity gaps
If events before login are logged under an anonymous ID, and the join key is user_id, early actions are missed. Confirm the identity stitching from the earlier chapter before trusting a window that starts at signup.
Writing a definition card
Keep a short, written definition for every metric on a dashboard. A compact format:
| Field | Example |
|---|---|
| Name | 7-day activation rate |
| Population | Users who signed up in the period, excluding internal accounts |
| Denominator | All users in the population |
| Event | `project_created` where `is_template = false` |
| Window | From the user's `signup_at` up to, but not including, 7 × 24 hours later |
| Time zone | UTC |
| Maturity rule | Only users with a complete window |
| Owner | Growth analytics |
| Version | v2, changed 2026-02-10 to exclude template projects |
The version line matters. When a definition changes, the trend line breaks. Record the change, and recompute history with the new definition where you can, so the series stays comparable.
Rates versus counts
Not every metric is a rate. Counts such as "number of weekly active users" still need an event and a window, though the denominator is absent. Even so, the population matters: are deleted accounts included? Are users counted if they were active in a different workspace? The same three questions apply.
Checklist
- Write the population, with exclusions.
- Name the event exactly, with property filters.
- State the anchor and length of the window, the boundary rule, and the time zone.
- Check that the denominator includes users with no event.
- Apply a maturity rule so incomplete windows do not bias the rate.
- Record the version and owner.
Exercise
A teammate reports "30-day retention is 64%" from a query that counts users with any app_opened event in the last 30 days, divided by all users who ever signed up. Name the population, event, and window problems in this definition, and propose a tighter one.
Show answer
Population: the denominator is every user who ever signed up, including very old and churned accounts, and it mixes users at different ages. Use a signup cohort (for example, users who signed up in a given month) and exclude internal accounts. Event: app_opened can fire from notifications or background refresh, so it overstates real use. Use a core value event such as core_action. Window: "the last 30 days" is a calendar window and ignores each user's own start, so recent signups have had less time than older ones. Anchor to each user's signup, for example "performed core_action on day 30 after signup, or in days 28 to 30," and only include users whose window has completed. A tighter definition: "Of users who signed up in January 2026, excluding internal accounts, the share who performed core_action between day 28 and day 30 after their own signup, measured in UTC."
Exercise
In the activation query, you move a.event_name = 'project_created' from the ON clause into WHERE. The rate jumps to 1.0. Why?
Show answer
With the filter in WHERE, rows where the LEFT JOIN found no matching event have a.event_name equal to NULL, and the condition removes them. Only users with a matching event remain, so COUNT(DISTINCT u.user_id) equals COUNT(DISTINCT a.user_id). Keeping the filter in ON preserves non-activated users in the denominator.