What Exactly Are We Counting?
Before you count, look inside the box
You're about to count users. Don't rush. First answer this: what in this archive actually represents a user? — QUERY

Kotomarket's black box isn't a “users” table or a “metrics” table. It's an event log: a long list of rows, each one recording that something happened at a particular time.
Here are nine rows from a single day—March 14:
| time | user_id | session_id | event | properties |
|---|---|---|---|---|
| 09:12:04 | 4412 | s-101 | app_open | source=push |
| 09:12:31 | 4412 | s-101 | product_view | item=bowl |
| 09:13:02 | 4412 | s-101 | product_view | item=scratching post |
| 09:13:40 | 4412 | s-101 | add_to_cart | item=scratching post |
| 09:20:11 | 7781 | s-102 | app_open | source=direct |
| 09:21:55 | 7781 | s-102 | product_view | item=bed |
| 14:02:09 | 4412 | s-140 | app_open | source=direct |
| 14:03:44 | 4412 | s-140 | purchase | sum=$12.90 |
| 21:47:00 | 9003 | s-166 | app_open | source=ads |
Each column answers a different question:
- time — when it happened. You can use event time to define periods such as a day, week, or month;
- user_id — who performed the action. The same user keeps the same id across all their visits;
- session_id — which visit the action belongs to. A new session gets a new id;
- event — what the user did;
- properties — details about that specific action: where the user came from, which product they viewed, or how much they spent.
The main idea to remember is that metrics are not stored in the black box. It stores events and their attributes. A metric is an instruction for turning the event log into a number. The analyst defines the instruction, and the result depends on the counting rules.
Same data, four different answers
Take the same nine rows and ask four simple questions.
How many events? Nine—one per row. This is the most straightforward count: the number of records in the log.
How many users? Three—4412, 7781, and 9003. User 4412 appears six times in the log, but they're still one user. Here we deduplicate by user_id.
How many visits (sessions)? Four—s-101, s-102, s-140, s-166. User 4412 visited twice: once in the morning and once in the afternoon.
How many orders? One—there is exactly one purchase event in this data.
9 events → 4 sessions → 3 users → 1 order
Nine, four, three, one. The data didn't change; the counting unit did. None of these four numbers is more correct than the others because each answers a different question.
This gives you your first professional habit: whenever you hear a number, ask what unit it represents. “We have forty thousand”—forty thousand what: events, people, visits, purchases? In the Kotomarket example, nine events become one purchasing customer only after we change the question and the counting method.
Entry No. 2 in L.'s log:
For six months, the council was shown “activity” counted as events and compared with the number of customers in billing. Nobody noticed they were dividing apples by kilometers. The “events per customer” ratio kept rising, so everyone celebrated higher engagement. It turned out that for some users, the app was restarting by itself.
For a log like this, keep one sanity check in mind: over the same period, there can't be fewer events than sessions, or fewer sessions than users, provided every event belongs to a session and every user has at least one session. If a report shows more “users” than “events” under those conditions, that's a sign to check the calculation.
A metric definition has four parts
A metric isn't just its name. The name is the label on the jar; the definition tells you what's inside. A complete definition answers four questions:
- Object — what are we counting as individual units: users, sessions, orders, events?
- Event — what must happen for the object to be counted: open the app, view a product, make a payment?
- Period — what time window are we using: a calendar day (and in which time zone?), a calendar week, the last 7 days?
- Counting method — do we count unique objects or every match? Do we sum, average, or calculate a share?
Here's a complete definition worth getting used to:
DAU = the number of unique user_id values (object) with at least one
app_openevent (event) during a calendar day in Miami time (period), with each user counted once (counting method).
Long? Yes. But a definition this precise lets two different people calculate the same number.
Unique users vs. event count
The most common mix-up happens in the fourth part. Compare these two definitions for the same day:
| definition | March 14 |
|---|---|
number of app_open events | 18 400 |
number of unique users with app_open | 4 200 |
Both numbers are valid and both come from the same log, but they differ by about 4.4×. They also react differently to changes in the data: if a bug makes the app restart and record extra app_open events, the first number will rise while the second won't. The first tells you how many times the event happened; the second tells you how many different users performed it.
Rule: whenever you hear “how many users do we have,” mentally add the word unique—then check that the calculation actually counts them that way.
Why two analysts get different numbers
Entry No. 5 in L.'s log. A manager asks two analysts for “the number of active users in March.” They come back with two answers: 41 200 and 33 900. Both calculated carefully, and neither made an arithmetic mistake. Their definitions differed here:
| part of the definition | first analyst | second analyst |
|---|---|---|
| object | unique user_id | unique user_id |
| event | any event in the log | only app_open |
| period | March 1–31 | 30 days ending March 31 |
| counting method | unique | unique |
The difference is 7 300 people, or about 18% of the larger value. There's no point arguing about who is right: both calculations follow their definitions. The question was incomplete.
Look at where the definitions diverged: the second and third rows. The first analyst counted anyone as active if they left any trace at all, including users who simply received a push notification whose delivery the system recorded. The second required an intentional app open. They also used different windows: the first used 31 calendar days, while the second used 30 consecutive days ending March 31.
A typical beginner mistake is assuming the definition is “obvious” and hesitating to ask for clarification. In practice, asking “Who exactly counts as active, and over what window?” shows professional judgment. The mistake is silently choosing your own definition and handing over a number without explaining what it means.
Here's an investigator's rule you'll use throughout the rest of the course:
Before you calculate anything, write the definition in one sentence—object, event, period, counting method—and show it to the stakeholder. Five minutes spent agreeing on the definition can save a day of rework and prevent a conclusion based on a different definition of the metric.
If the number goes into a report, include the definition with it as a footnote under the table. A month later, you may not remember exactly what you meant either.
print. Below are the March 14 log totals counted using four different units. Run it, then change the numbers and watch how the ratios change.events_per_user) and sessions per user (sessions_per_user). Both use simple division; no rounding is needed.purchase events, while there are 1 050 unique user_id values among them. Calculate by how many people the report overstated the number of buyers (overcount) and how many orders there are per buyer (orders_per_buyer).Key takeaways
- the black box contains events, not metrics; a metric is an instruction for turning the log into a number
- the same rows produce different numbers depending on the counting unit: events, visits, users, orders—always clarify which unit the number represents
- a metric definition has four parts: object → event → period → counting method
- unique users and event counts are different metrics; one user can generate multiple events
- if the definition isn't fixed, two analysts can calculate the same metric differently and get different numbers
Next comes our first real metric: DAU. We'll build it from these four parts and see how the same word, “active,” can produce three different answers.