Sub topic 3
Defining a Metric Precisely: Population, Event, and Time Window
Assume you know how software products are used, can work with percentages and ratios, and understand basic SQL such as SELECT, JOIN, and GROUP BY. This chapter uses those skills to turn a vague product question into a reproducible metric.
A product metric is a number calculated from user behavior. A useful metric must specify three things:
- Population: Which users are included?
- Event: What behavior counts?
- Time window: When must the behavior happen?
Without all three, two analysts can calculate different answers and both believe they are correct.
The three parts of a metric
Suppose a team asks, “What is our activation rate?” This question is incomplete. A precise definition might be:
> The percentage of users who signed up in January 2026 and created a project within seven days of signup.
This definition identifies:
- Population: Users who signed up in January 2026.
- Event:
project_created. - Time window: From each user’s signup time until seven days later.
The window is relative to each user’s signup. It is not simply the first seven calendar days of January.
| Metric part | Question to answer | Example |
|---|---|---|
| Population | Who is in the denominator? | January signup cohort |
| Event | What behavior qualifies? | Created a project |
| Time window | When must it occur? | Within seven days of signup |
Why the denominator matters
The denominator is the population. If you count all registered users instead of January signups, the rate answers a different question.
For example, suppose 100 users signed up in January and 35 created a project within seven days. The activation rate is:
35 / 100 = 35%If the same 35 users are divided by 1,000 total registered users, the result is 3.5%. That number may be mathematically correct, but it does not measure January activation.
The population should also exclude records that cannot satisfy the question. If you measure activation after signup, users without a valid signup timestamp need a defined treatment rather than silently entering the denominator.
Choosing the event
An event is a recorded user action, such as project_created, invoice_sent, or report_shared. Choose an event that represents meaningful progress toward user value.
Avoid using vague events such as “opened the app” when opening the app does not show that the user received value. Also define whether repeated events count once or many times. Activation usually counts each user once, even if that user creates ten projects.
Writing the query
The following PostgreSQL query calculates seven-day activation for January signups:
-- Assumes:
-- users(user_id, signup_at)
-- events(user_id, event_name, event_time)
SELECT
COUNT(DISTINCT e.user_id) * 1.0
/ COUNT(DISTINCT u.user_id) AS activation_rate_7d
FROM users AS u
LEFT JOIN events AS e
ON e.user_id = u.user_id
AND e.event_name = 'project_created'
AND e.event_time >= u.signup_at
AND e.event_time < u.signup_at + INTERVAL '7 days'
WHERE u.signup_at >= DATE '2026-01-01'
AND u.signup_at < DATE '2026-02-01';The LEFT JOIN keeps users with no qualifying event in the denominator. The DISTINCT count prevents multiple project creations from counting the same user more than once. The half-open interval includes the signup moment and excludes the exact seven-day boundary.
A practical definition checklist
Before publishing a metric, record:
- The user or account unit being counted.
- Inclusion and exclusion rules.
- The exact event name and required properties.
- Whether each entity counts once or multiple times.
- The start and end of the time window.
- The timezone used for calendar boundaries.
- The data source and refresh time.
Exercise
A team divides the number of users who uploaded a file within 14 days of signup by all users who have ever registered. What part of the metric definition is inconsistent, and how would you correct it?
Show answer
The population and time frame do not match. Use users who signed up in a defined cohort as the denominator, then count how many of those users uploaded a file within 14 days of their own signup.