Release: New Funnel Discovery model - find critical paths in user journeys

Ivar Pruijn

In this release, we've added a Funnel Discovery model to the open model hub that enables you to uncover which paths in all user journeys impact your product goals, and analyze opportunities for improvements to your product.

A desire path carved out by its users. Photo by Jan-Dirk van der Burg.

A desire path carved out by its users. Photo by Jan-Dirk van der Burg.

If you run a traditional funnel analysis, you predefine the steps of the funnel, and then analyze the differences for user attributes or behavior in each step.

However, just like desire paths in real life can break an arguably well-thought-out street layout, making assumptions about which flows people take in your product doesn’t always match reality.

Similarly, in traditional funnel analysis, this means you may miss important, impactful paths that users actually take, e.g. because they’re not very obvious or not used much yet. Finding out which paths drive users towards your goals and which ones drive them away provides major opportunities to optimize or otherwise improve your product.

This is where Funnel Discovery comes in: to discover all the (top) paths that lead to conversion or drop-off, and be able to run subsequent analyses on them.

An example: journeys that lead to conversion

Let’s have a look at how you can analyze paths that convert to your goal, and how to learn from them, using the new Funnel Discovery model.

First, you have to define which events you see as conversion to your product goal. In this example we will view someone as converted when they go from our website to the documentation, but you can use any event.

# instantiate the FunnelDiscovery model from the open model hub
funnel = modelhub.get_funnel_discovery()
# define which data to use as conversion events; in this example, anyone who goes on to read the documentation
df['is_conversion_event'] = False
df.loc[df['application'] == 'objectiv-docs', 'is_conversion_event'] = True

Now you can easily find the paths that actually lead to conversion. Just call the Funnel Discovery model’s get_navigation_paths operation to find all the paths users took, and limit it to the ones that resulted in conversion. In this example we use a maximum of 4 steps for simplicity:

# get paths that resulted in conversion (with the `only_converted_paths` param), including the step of conversion (with the `add_conversion_step_column` param)
df_steps_till_conversion = funnel.get_navigation_paths(df, steps=4, by='user_id', add_conversion_step_column=True, only_converted_paths=True)
df_steps_till_conversion.head(5)
/img/blog/releases/20220811/dataframe-paths-conversion.png

The model also allows you to visualize these paths using a Sankey diagram. This helps you select which are most interesting to analyze further. In this example we’ll filter it to conversion on the 4th step, and a maximum of 15 flows, for simplicity.

 # filter down to sequences that converted on the 4th step
condition_convert_on_step_4 = df_steps_till_conversion['_first_conversion_step_number'] == 4
# plot the Sankey diagram using the top 15 examples via the `n_top_examples` param
funnel.plot_sankey_diagram(df_steps_till_conversion[condition_convert_on_step_4], n_top_examples=15)

See a screenshot of the resulting Sankey Diagram below. The width of each link represents the amount of times that flow was used, and you can hover over each link to see the source and target node.

Sankey Diagram for paths that converted users have taken

Sankey Diagram for paths that converted users have taken

You can interact with the diagram to understand the paths that lead to conversion, and decide which to analyze further.

Another example: What makes users not convert from marketing campaigns?

The same analyses can be run for journeys that start from a marketing campaign, e.g. to analyze why campaigns do or do not convert.

# first, add marketing data to the dataframe
df_marketing['utm_campaign'] = df_marketing.global_contexts.gc.get_from_context_with_type_series(type='MarketingContext', key='campaign')
# filter the dataframe down to users that came in via a marketing campaign
user_list = df_marketing[~df_marketing['utm_campaign'].isnull()].user_id
df_marketing = df_marketing[df_marketing['user_id'].isin(user_list)]
# define which data to use as conversion events; in this example, anyone who goes on to read the documentation
df_marketing['is_conversion_event'] = False
df_marketing.loc[df_marketing['application'] == 'objectiv-docs', 'is_conversion_event'] = True

To look at just the users who did not convert, filter the data down and plot the Sankey Diagram:

# filter to non-converted users
df_marketing_non_converted = df_marketing[df_marketing['user_id'].isin(users_non_converted)]
# get their paths, and plot the diagram
df_steps = funnel.get_navigation_paths(df_marketing_non_converted, steps=4, by='user_id')
funnel.plot_sankey_diagram(df_steps, n_top_examples=15)

See a screenshot of the resulting Sankey Diagram below. Remember that the width of each link represents the amount of times that flow was used, and you can hover over each link to see the source and target node.

Sankey Diagram for paths that non-converted users have taken from a marketing campaign

Sankey Diagram for paths that non-converted users have taken from a marketing campaign

This allows you to understand the paths that lead to users dropping off after entering from a marketing campaign, and decide on which to analyze further.

How to get the new Funnel Discovery model

Install the modelhub/Bach packages from PyPI:

pip install objectiv-modelhub

Or upgrade if you’ve already installed it:

pip install --upgrade objectiv-modelhub

Summarizing

This release adds a new Funnel Discovery model to the open model hub. Unlike traditional funnel analysis, where you predefine the steps of the funnel and can thus miss impactful paths that users actually take, this new model enables you to first uncover which paths users take that impact your product goals. You can plot an interactive Sankey diagram to understand all the paths that lead to conversion or drop-off, and decide which ones to analyze further.

info

Office Hours

If you have any questions about this release or anything else, or if you just want to say 'Hi!' to team Objectiv, we have Office Hours every Thursday at 4pm CET, 10am EST that you can freely dial in to. If you're in a timezone that doesn’t fit well, just ping us on Slack and we'll send over an invite for a better moment.

Join the Office Hours

Try Objectiv

Get Objectiv Up - Try Objectiv on your local machine (takes 5 minutes)
Objectiv on GitHub - Check out the project and star us for future reference
Objectiv on Slack - Join the discussion or get help