What are cohorts?
Cohorts enable you to easily create a list of users who have something in common, such as completing an action or having the same property.
Here are a few examples of the cohorts you can create:
- Users who work at the same company.
- Users who used your app in the last week.
- Users who churned from your product.
- Users who signed up recently.
- Users who viewed the signup page, but didn't convert.
Your cohorts are available in the People page under the Cohorts tab.
Note: Cohorts rely on person properties, so you need to capture identified events to create them.
Where can you use cohorts?
You can use cohorts in many different ways, such as:
- In trends, funnels, retention, user paths, stickiness, and lifecycle insights
- As a filter on any product analytics dashboard
- To target feature flags, experiments, and user surveys
- To filter the session replay list and create playlists
- Filter live events on the Activity page
- Filter users on the People page
You can use cohorts to answer questions like:
- "Are people at company X using our app frequently?"
- "What percentage of the users who signed up last week are still using our app?"
- "Which features are power users using the most?"
How are cohorts different from groups?
Cohorts are sometimes confused with groups, but they each serve different purposes:
Cohorts represent a specific set of users – e.g., a list of users who's email contains a certain string (like a company's domain).
Groups aggregate events based on entities, such as organizations or companies, but do not necessarily connect to a user. They enable you to analyze trends, insights, and dashboards at an entity-level (like a company or organization), as opposed to a user-level.
Groups require additional code in your app to set up, while cohorts are created in PostHog and don't require additional code. This makes cohorts easier to use and quicker to get started.
If your only goal is to create a list of users with something in common, we recommend cohorts instead of groups.
How to create a cohort
Once you've captured identified events, there are two ways to create a new cohort:
Method 1: Create a new cohort directly from an insight
You can create cohorts using data from insights such as trends, funnels, user paths and lifecycles.
Go to insights and open any insight that's aggregated at a user-level, like
unique users
orweekly active user
.Click a data point in the visualization to view the persons represented in the underlying data.
In the modal popup, click Save as cohort at the bottom.
The video below shows how to create a new cohort from a trend, although you can similarly create a cohort from a funnel, user path, or any other insight.
Method 2: Create a new cohort from the cohorts page
Navigate to the People page within the sidebar, then click on the Cohorts tab.
Click + New Cohort on the top right.
Static and dynamic cohorts
You have two options when creating a cohort:
Static cohorts, lists of users that don't change over time (unless you update them manually). For example, all the users who signed up to your app in January 2024.
Dynamic cohorts, which are automatically updated based on a specific condition – e.g. all users who have performed a specific event or action in your app.
Static cohorts
Static cohorts are created from insights, by uploading a CSV of users, or by duplicating a dynamic cohort.
The CSV file only requires a single column with the user's distinct ID. The very first row (the header) will be skipped during import.
To update the list, you can either upload another CSV to add more users, or use the interface to remove users.
Dynamic cohorts
Dynamic cohorts can be based on existing cohorts, and support the following criteria:
Behavioral
Event or action | Example |
---|---|
Completed event or action | Completed user signed up in the last 30 days |
Did not complete event or action | Did not complete user signed up in the last 2 months |
Completed event or action multiple times | Completed watched video 5 times in the last 2 weeks |
Completed a sequence of events or actions | Completed user signed up in the last 5 days followed by watched video within 1 day of the initial event |
Did not complete a sequence of events or actions | Did not complete user signed up in the last 5 days followed by watched video within 1 day of the initial event |
You can select days
, weeks
, months
or years
time ranges here.
Person properties
Has or doesn't have a person property with the following operators:
Operator | Example |
---|---|
equals or does not equal | Pineapple on pizza property does not equal "true" |
contains or does not contain | email property does not contain "gmail" |
matches regex or does not match regex | Country code property matches regex "us |
greater than or greater than or equal to | Age property is greater than "21" |
less than or less than or equal to | Age property is less than or equal to` "21" |
is set or is not set | UTM Source property is not set |
between or not between | Age property is between "18" and "30" |
minimum or maximum value | Organization size property minimum of "5" |
Lifecycle
Criteria | Example |
---|---|
Completed and event for first time | Completed shared insight event for the first time in the "last 30 days" |
Completed an event regularly | Completed shared insight at least "3 times per week" for at least "3 of the last 5 periods" |
Stopped doing an event | Stopped doing shared insight event in the "last 5 days" but had done it in the "5 days prior" |
Started doing event again | Started doing shared insight event in the "last 5 days" but had not done it in the "5 days prior" |
You can select days
, weeks
, months
or years
time ranges here.
FAQ
How often are dynamic cohorts updated?
Dynamic cohorts are updated once every 24 hours.
Can you use a dynamic behavioral cohort as a feature flag target?
No. To target a dynamic cohort for a feature flag, A/B test, or survey, you must first duplicate it to a static cohort.
Can you use groups in cohorts?
Not yet, but we are working on rewriting cohort calculations in HogQL which will unlock your ability to do this.