Cohorts

Last updated:

|Edit this page

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.

  1. Go to insights and open any insight that's aggregated at a user-level, like unique users or weekly active user.

  2. Click a data point in the visualization to view the persons represented in the underlying data.

  3. 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

  1. Navigate to the People page within the sidebar, then click on the Cohorts tab.

  2. Click + New Cohort on the top right.

left hand navigation for cohorts

Static and dynamic cohorts

You have two options when creating a cohort:

  1. 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.

  2. 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 actionExample
Completed event or actionCompleted user signed up in the last 30 days
Did not complete event or actionDid not complete user signed up in the last 2 months
Completed event or action multiple timesCompleted watched video 5 times in the last 2 weeks
Completed a sequence of events or actionsCompleted 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 actionsDid 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:

OperatorExample
equals or does not equalPineapple on pizza property does not equal "true"
contains or does not containemail property does not contain "gmail"
matches regex or does not match regexCountry code property matches regex "us
greater than or greater than or equal toAge property is greater than "21"
less than or less than or equal toAge property is less than or equal to` "21"
is set or is not setUTM Source property is not set
between or not betweenAge property is between "18" and "30"
minimum or maximum valueOrganization size property minimum of "5"

Lifecycle

CriteriaExample
Completed and event for first timeCompleted shared insight event for the first time in the "last 30 days"
Completed an event regularlyCompleted shared insight at least "3 times per week" for at least "3 of the last 5 periods"
Stopped doing an eventStopped doing shared insight event in the "last 5 days" but had done it in the "5 days prior"
Started doing event againStarted 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.

Further reading

Questions?

Was this page useful?

Next article

Events

An event is the core unit of data in PostHog. It represents an interaction a user has with your app or website. Examples include button clicks, pageviews, query completions, and signups. Events consist of: An event name like $pageview or query completed . Events starting with $ are PostHog defaults. A distinct_id which is a unique identifier for person , commonly a uuidv7 value like 018daf23-89b3-7cf8-a4f1-94064c96df90 A timestamp in ISO 8601 format, which is the time the event…

Read next article