We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Funnel Drop-Offs

Sometimes you want to dig into your funnels even further to find who dropped off at a given step. I use Python set operations to deduplicate my users into cohorts.

viewers = set(events[events["event_type"] == "page_view"]["user_id"])
signups = set(events[events["event_type"] == "signup"]["user_id"])
submitters = set(events[events["event_type"] == "lesson_submit"]["user_id"])
buyers = set(events[events["event_type"] == "purchase"]["user_id"])

You can subtract one set from another to find users who were in the first but not the second. For example, users who viewed but never signed up:

dropped_at_signup = viewers - signups
print(f"{len(dropped_at_signup)} users viewed but never signed up")

Or users who signed up but never submitted a lesson:

dropped_at_submit = signups - submitters

Once you have the set of dropped users, you can filter back to the event log and look at what they did do. Sometimes you find they used a different path that you didn't expect.

Assignment

SnackStack's onboarding team wants to email setup help to everyone who stalled at a specific step: they completed an earlier step, but never did the later one.

Complete the find_dropped_users function. It accepts an events DataFrame with user_id and step columns, plus a from_step and a to_step. It returns the IDs of the users who dropped off between the two steps.