User paths

Last updated:

|Edit this page

User paths are a type of insight that enable you to follow users along their journey through your product and determine where the biggest drop-offs are.

You can learn the following from paths:

  • Where users are getting confused or stuck.
  • Which parts of your app people are actually using.
  • Why users aren't discovering new features.
  • Where new users are landing into your marketing website.
Example of a paths insight

How to create a paths insight

  1. Click Product Analytics on the left sidebar
  2. Click the + New insight button
  3. Select the User Paths tab
Switching the event type

Understanding paths

Paths can be overwhelming at first, especially if they have many steps. To help you understand them better, here's a simple example:

Path visualization with only 2 steps

Each step along the path is a page that the user viewed, and the horizontal bars correspond to a user navigating from one page to another. The numbers next to the paths correspond to how many distinct users passed through this specific step along the way.

In the above, the first step shows that 268 people viewed the homepage /homepage. From the homepage, we can see that people either viewed the /docs/tutorials page next, or the /docs/...gramming page next, or the /docs/paths page, and so on.

Exploring a specific step within a path

You can dig deeper into a specific step by hovering your mouse over it:

Dropoff

This gives us the exact conversion rate of this step, as well as the average time it took users to get here from the previous step. In addition to this information, you can also click on the ••• icon to bring up a menu with a number of actions for this step:

  • Set as path start - Sets this step as the starting point for your path. This is useful for exploring where your users navigate to after a specific step.
  • Set as path end - Sets this step as the ending point for your path. This is useful when analyzing the ways a user ends up at a specific step or learning why users dropped off.
  • Exclude path item - Adds an exclusion rule for this specific event.
  • View funnel - Opens a new funnel insight with this event already set as the first step. This is useful when analyzing drop-off of a specific step.
  • Copy path item name - Copies the event name to your clipboard.

Viewing recordings and creating cohorts from a step

One of the most powerful features of paths is the ability to see all the users who passed through a specific step. To do this, click on the number next to the name of step. This brings up a list of all of these users.

list of users who reached a step

You can then create a cohort of users who passed through the step by clicking the Save as cohort.

If you have enabled session replays, you can also see recordings of a user sessions for this step by clicking the View recording button. This is helpful when diagnosing problems with your funnels.

Configuration options

This next section provides detailed information on the different configuration options of the paths insight.

Configuration options for creating paths

Event types

There are 4 types of events that PostHog can display user paths for. You need to select at least one, and you can select any combination of the four.

Page views

This options shows paths for the $pageview event sent by our web libraries. Each step of the path is broken down by the Current URL property.

This also means that you can see a continuous path of your users even if they navigate across domains.

Screen views

This option shows steps for the $screen events sent by our mobile app libraries. Each step of the path is broken down by the $screen_name property.

Custom events

This contains all events other than the $pageview and $screen event. When displaying paths for these events, they will be broken down by name, with each step corresponding to an event a user performed in succession.

HogQL expression

You can also write your own custom queries path steps using HogQL expression.

For example, the following expression will filter to only show pageviews on Chrome:

if(event = '$pageview' and properties.$browser = 'Chrome', properties.$current_url, null)

Wildcard groups

Wildcard groups are an advanced feature that allows you to group multiple events together into a single step based on certain patterns. They work by using the * character to replace a unique pattern in a string.

Wildcard groups are typically used when you're dealing with URLs that contain unique values or IDs, and you want to combine all of these paths into a single step.

For example, if you have URLs with the format /product/{product-id}, you can use the pattern /product/* to group them together.

When using wildcards on custom events, the pattern will be matched against the event name itself. For example,dashboard * will match the events with names such as dashboard created and dashboard viewed.

Path cleaning rules

Path cleaning rules are an advanced version of wildcard groups. They use regex to match instead of the simple * wildcard.

Path cleaning rules consist of two parts:

  • Regex – used to match the various URLs you would like to combine.
  • Alias – used to replace the portion that matched the regex.

Path cleaning rules can either be added directly to an insight, or you can configure global path cleaning rules in your project settings.

Create path cleaning dialogue

As an example, say your app uses a URL structure of the form /merchant/<merchant_id>/dashboard. Within your paths insight, you don't want to show different URLs for each merchant dashboard.

To combine them all into a single step, use the regex \/merchant\/\d+\/dashboard$ and set /merchant/dashboard as the alias. Now, any pageview events that match the regex will have their path replaced with /merchant/dashboard.

For example, https://example.com/merchant/12345/dashboard https://example.com/merchant/6789/dashboard would both become https://example.com/merchant/dashboard and be shown as a single step.

Exclusions

Exclusions enable you to remove events entirely from being displayed in a path.

Excluding two events

Number of people on each path

This enables you to set the minimum and/or maximum number of people who performed the path in order for it to be displayed. This is especially helpful in reducing the density of the visualization since it removes paths from the insights.

For example, you can set a minimum of 100 users per path to remove the most uncommon paths users took.

Setting the number of steps

There is an option right above the graph to select the number of steps to display.

Select number of paths

Increasing the number of steps will show a longer portion of a user's journey through your product. The drawback is that too many steps can often show a cluttered view. To fix this, see above on how to exclude certain events.

Questions?

  • Or
    2 months ago

    Can't add path cleaning rules

    In the product analytics settings, under Path cleaning rules I can't see the "add rule" button even though I'm an admin in my organization. What should I do in order to enable it?

  • Tomasz
    2 months ago

    No 'ending point' in User Paths insight

    hi, I have only 'Starts at' point in user paths, but there is no 'ending point' value to pick up. Why is that and how can I change it?

  • luciano
    2 months ago

    How to identify user paths based on backend created custom events

    I have a chatbot flow, in which the bot acts as an AI agent with different tools. I am sending an event for each tool usage.

    I want to understand all the different ways my users are interacting with the agent, using user paths and/or sessions

    I don't know how to make posthog identify that these events should become part of a single user path. For example: A user creates a blog post and then asks the agent to modify it based on feedback twice in a row.

    I'd like to have a user path like the following:

    1. post_creation
    2. post_modification
    3. post_modification

    Is that possible?

    • David
      a month ago

      Hey Luciano, we've been getting this request a lot and have an LLM Observability product in beta. You can try it in Feature Previews which opens in the lower left from your user avatar.

  • Sebak
    8 months ago

    What are the numbers shown on path trace?

    I have implemented path trace to view what users do after landing on my website. The card of the path trace show number 10 but when I click on that a modal opens and it shows me 16 unique users.

    So what is the 10 that is shown on the initial path trace UI?

    Screenshot 2024-06-12 141041.png

    • Saurav
      8 months ago

      There is some other issue also. After clicking 2-3 times on the number shown on card, it is showing different number of users.

  • Konstantin
    9 months ago

    Different numbers for the same event when using funnels and user paths?

    Hi! Why can I see the different numbers for the same event when using funnels and user paths? For example I build funnel where Step 1 is some custom_event_1. Then I built user path starting with the same event_1 and see different number of users in different reports.

    • Marcus
      8 months agoSolution

      Hey, the user paths chart cannot be directly compared to the trends insight. It uses a differently optimized query to come up with paths that the users took, based on the starting and end points. This means that what you see might now match up with the expected number of total users. When 100 users for example enter through 100 different pages into their sessions, the overall paths insight might now show all of them since these numbers are too small and it wouldn't make sense for a lot of use cases to display this level of granularity.

  • lisa
    9 months ago

    using actions in user flows?

    Hi, is it possible to use predefined 'actions' in the user flows chart? We have defined many actions to relate specific events and want to map these

    • ed
      7 days ago

      I would love this!

  • Angelica
    a year ago

    Differentiate events

    Is there a way to differentiate between two or more events that have the same event name but different attributes? We would like treat this events as different, although they have the same name. Thanks in advance.

    • Marcus
      a year ago

      Hey Angelica, that is not possible right now. Could you share some context on your use case?

  • Nick
    a year ago

    normalize UTM params

    In case anyone runs into this— I normalized across GTM params using this path cleaning regex: \/\?gclid=.*

  • Dagmar
    2 years ago

    number of steps

    Hi, I can't change the number of steps to more than 5 in my user path insight. I am using free/open source version. Is that possible? thank you

    • Andy
      2 years agoSolution

      Users paths are limited in the open source edition. If you switch to Cloud, you can unlock unlimited paths by inputting a card. Provided you remain below 1 million events / 15k recordings per month, you won't be charged.

Was this page useful?

Next article

Stickiness

Stickiness is a type of insight that enables you to see how many times users perform an event within a specific time period. This is useful for tracking if a particular feature is engaging for users. For example, if you track Weekly Active Users , stickiness highlights those that are the most engaged within that week. Stickiness helps you answer questions such as: How frequently are users engaging with my product? Who are my most engaged users? Are users engaging more with my product now than…

Read next article