From Event to Metric: How Data Becomes a Number
The four parts of an event row
| Part | What question does it answer? | Example |
|---|---|---|
user_id | who did it | 4412 |
event_name | what they did | add_to_cart |
event_time | when | 2184-03-14 19:01:47 |
| properties | details | product_id=812, platform=android, app_version=4.12 |
In our simplified model, every event has the first three fields. event_name tells us what happened, event_time tells us when, and user_id lets us connect actions performed by the same user. Real systems can also contain anonymous events with no known user_id, but for now we'll use the simpler model.
Properties (also called event parameters) vary by event type: a purchase might include the order amount and payment method, while a search might include the search query and the number of products found. You can later use properties to break a metric into segments — for example, “show DAU separately for Android and iOS.”
Kotomarket used short snake_case names for events: app_open, product_view, add_to_cart, checkout_start, purchase. Consistent naming matters for more than keeping things tidy. If half the team records the same action as add_to_cart and the other half calls it cart_add, a query that looks only for add_to_cart will miss some real add-to-cart actions.

An event is not an object
An object is an entity with a current state: user 4412 (Furrville, registered January 2), order №812 (status “delivered,” $12.90), product “Hammock bed” (price, inventory). An object's state changes: for example, an order can move from “paid” to “delivered.”
An event is a fact that occurred at a particular moment. The record “19:02:03, checkout_start, order 812” describes that exact moment. It doesn't later turn into a different event even if the order is eventually canceled. In an event log, records like this are usually kept as a history of what happened, while each new change is recorded as a separate event.
This leads to a distinction that's easy to miss in your first calculations:
users table: 1 row = 1 user → 380 000 rows
orders table: 1 row = 1 order → 4 100 000 rows
events table: 1 row = 1 action → 1 900 000 000 rows
An event table usually has far more rows than object tables because one user can perform hundreds of actions. So the number of rows in events is the number of recorded actions, not the number of users. To count users from events, you need to count unique user_id values rather than every row.
From rows to a number
Let's take eight rows from one evening and calculate a few metrics from them. We'll do each step by hand so you can see where every number comes from.
# user_id event_name event_time
1 4412 app_open 19:00:04
2 4412 product_view 19:00:12
3 4412 add_to_cart 19:01:47
4 4412 purchase 19:02:58
5 7781 app_open 19:02:15
6 7781 product_view 19:02:41
7 2043 app_open 19:05:10
8 2043 purchase 19:07:33
Metric 1 — DAU:
- Take all rows from the day we need — here, all eight.
- Keep one column,
user_id:4412, 4412, 4412, 4412, 7781, 7781, 2043, 2043. - Remove duplicates:
4412, 7781, 2043. - Count what's left: DAU = 3.
Here, we define an active user as someone who generated at least one event during the day. In a real product, the exact definition of DAU may differ — for example, a team might count only certain events. The important thing is to define the rule in advance.
Metric 2 — number of orders:
- Filter the rows where
event_name = purchase— rows 4 and 8 remain. - Count the rows: orders = 2.
Notice the difference: for DAU, we removed duplicate users; for orders, we didn't. That's correct. If 4412 had bought twice that evening, that would be two orders but still one active user.
For these two metrics, the process is similar: select the rows you need → decide whether you need unique entities → count. But not every metric comes down to counting rows. To calculate average order value (AOV), for example, you'll also need to add up revenue and divide it by the number of orders.
Turning many rows into a single result is called . The aggregation rules are part of the metric's definition: whom to count, which events to include, whether to remove duplicates, and what to add or divide. Without those rules, the number itself tells you very little.
Metric 3 — conversion is calculated by dividing one metric by another: buyers / active users = 2 / 3 ≈ 66.7%, or 67% after rounding. There are also two buyers here — 4412 and 2043. That's different from the number of orders; the two numbers happen to match because each buyer placed one order that evening. Eight rows aren't enough to tell us much, but for a full day at Kotomarket, the calculation looked like this:
DAU on March 14 4 200
buyers (unique purchase users) 1 050
purchase conversion 25.0%
Here, 1 050 is the number of unique users who had a purchase, not the number of purchase events. Check the math: 1 050 / 4 200 = 0,25, or 25%.
Later, the metrics will become more complex: will require comparing users across periods, AOV will require working with purchase amounts, and will require combining a user's monetary results over a long period. The principle stays the same: first define exactly which rows and values you need, then apply the calculation rules, and only then get the final number.
One idea to remember throughout the course
Tracking is code in an app that sends events to an analytics system. A few lines written by a developer can break like any other code: when a screen is rewritten, a library is updated, or branches are merged.
Look at what happens if a new version of the app accidentally stops sending app_open, while the defines active users using that event:
before after
app_open per day 4 200 910 ← −78%
purchase per day 1 050 1 045 ← no change
The purchase data doesn't suggest that the audience actually disappeared: the number of purchase events barely changed. Users may still be opening the app, browsing the catalog, and buying things — a large share of app_open events simply stopped reaching the data.
The dashboard will still show a sudden drop. If an analyst immediately concludes, “we have an audience disaster,” the company may start fixing the wrong problem: rolling back the release, pouring money into advertising, or looking for a product issue even though the measurement is what broke.
This gives us a rule you'll use for the rest of the course:
When a metric drops, first check whether the measuring instrument failed.
One common sign of this kind of failure is that metrics stop agreeing with each other. If an activity metric falls by tens of percent while a related purchase metric barely moves, that's a reason to inspect data collection: which events are arriving, from which app versions, in what volume, and when the break first appeared.
But disagreement between metrics isn't proof by itself. A real business change can produce the same pattern. An analyst's job is to test the tracking hypothesis before explaining the drop as a change in user behavior.
The reverse can happen too, and it's more dangerous: broken tracking can hide a real decline. If purchase starts being sent twice by mistake, and the number of orders is calculated by simply counting those events without removing duplicates, the metric will roughly double. Against that inflated number, nobody may notice that real sales have fallen by a quarter.
Dashboard
A is a screen that brings together charts and metric values for a particular audience or question. Kotomarket's BI system was called “Console,” and its main dashboard looked something like this:
┌─ Console · Main ───────── March 14, 2184 ─┐
│ DAU 4 200 ▁▂▃▄▅▆▇ │
│ Buyers 1 050 ▂▃▃▄▅▅▆ │
│ Conversion 25.0% ▄▄▅▄▅▅▅ │
│ AOV $7.30 ▅▅▅▅▅▅▅ │
└────────────────────────────────────────────┘
A dashboard usually shows metrics, not raw events — numbers calculated from those events according to specific rules. Behind every line is the same kind of process you just worked through by hand.
That's why asking “how is conversion calculated here?” isn't a beginner's nitpick. It's one of the first questions an experienced analyst asks when looking at someone else's dashboard. For example, the share of buyers among all active users in a day and the share of buyers among users who opened a product page are two different metrics. They have different denominators, so they can lead to different conclusions.
L., entry #5: Three departments spent half a day arguing about a drop in conversion. By lunchtime, they discovered that marketing calculated it from ad clicks, product from app opens, and finance from unique payers. Nobody was wrong. Nobody had asked.
Key takeaways
- an event row =
user_id+event_name+event_time+ properties; properties let you split a metric into segments - an object — such as a user or order — can change state; an event records a fact that happened at a particular moment; there are usually far more events than objects
- a metric is built through the chain “filter → remove duplicates or not → count”; whether to count unique entities is part of the metric's definition
- when a metric drops, check the measuring instrument first: broken tracking can create a decline that never happened or hide a real change
- a usually shows calculated metrics rather than raw events; always ask what rule was used to calculate them