Sub topic 2
Step order and how conversions are counted
This chapter assumes you know how events and user IDs work in Amplitude or Mixpanel, and that you can read a funnel chart. A funnel is an ordered list of events. A conversion is a user who completes the steps in order.
How step order changes the count
A funnel counts a user as converted only when the steps happen in the set order. If a user finishes step 2 before step 1, that user does not count at step 2. The report checks each user's events in time order and advances one step at a time.
The example below runs this ordered count on a small event list.
events = [
{"user_id": "u1", "event": "Sign Up Started", "time": 1},
{"user_id": "u1", "event": "Sign Up Completed", "time": 3},
{"user_id": "u2", "event": "Sign Up Completed", "time": 2},
{"user_id": "u2", "event": "Sign Up Started", "time": 4},
{"user_id": "u3", "event": "Sign Up Started", "time": 5},
]
def ordered_funnel(events, steps):
by_user = {}
for e in events:
by_user.setdefault(e["user_id"], []).append(e)
counts = [0] * len(steps)
for user_events in by_user.values():
user_events.sort(key=lambda e: e["time"])
position = 0
for e in user_events:
if position < len(steps) and e["event"] == steps[position]:
position += 1
for i in range(position):
counts[i] += 1
return counts
print(ordered_funnel(events, ["Sign Up Started", "Sign Up Completed"])) # [3, 1]Three users started. Only u1 completed after starting, so the funnel shows 1 conversion out of 3.
Filtering and breaking down a funnel
A filter limits which users or events enter the funnel, such as users from one country. A breakdown splits the funnel into one funnel per property value, such as plan or source. Compare segments only when each has enough users. Two segments with 4 and 400 users are not comparable.
Reading drop-off and time to convert
Drop-off is the share of users who entered a step but did not reach the next one. Time to convert shows how long users took between steps. A median that is far longer than the conversion window suggests that the window is too short to capture real conversions. Check the median and the spread, because a few slow users can distort an average.
Defining cohorts: behavior, properties, dynamic and static
A cohort is a named group of users. A behavioral cohort is defined by actions, such as "completed sign-up in the last 30 days." A property-based cohort is defined by attributes, such as plan = pro.
A dynamic cohort updates as users enter or leave the definition. A static cohort is a frozen list captured at one moment.
| Type | Membership updates? | Good for |
|---|---|---|
| Dynamic | Yes, as behavior changes | Ongoing monitoring |
| Static | No, fixed at creation | Comparing a fixed group over time |
Exercise
Exercise
In the example above, why is u2 not counted as converted?
Show answer
u2 completed sign-up at time 2, before starting it at time 4. The ordered funnel only counts completions that follow the first step, so u2 does not count.