This article will help you:
- Create a behavioral cohort in Amplitude using the Cohort tab or Microscope features
- Import a cohort from a file
- Compare cohorts
- You may also find this course on cohorts in our Academy helpful.
In Amplitude, a cohort is a group of users who share a trait or set of traits. There are two different types of cohorts: predictive cohorts and behavioral cohorts. This article will explain how behavioral cohorts work, how to build them, and how to incorporate them into your Amplitude analyses.
Behavioral cohorts are defined by user actions taken within a specific time period. They allow you to group together different users based on the events they've triggered in your product. Once you've created a cohort, you can add them as a segment in many Amplitude charts.
Some examples of behavioral cohorts might be:
- Users who watch three consecutive episodes of a TV show in the first day after signing up for a video streaming service
- Users who enable push notifications during onboarding
- Android users who abandoned their carts on an e-commerce site in the last month
Ultimately, this sort of behavioral data reveals how engagement with your product affects retention, conversion, revenue, and other business outcomes you care about.
NOTE: This feature is only available to customers on Enterprise, Growth, and Scholarship plans.
Cohorts are extremely useful across the Amplitude platform. To segment your data by cohorts, select Cohort in the Segmentation Module, and then choose the cohort you're interested in from the drop-down list.
NOTE: For any chart or query that segments on a cohort, the segmented cohort will automatically recompute itself whenever the chart is generated. You can manually re-compute the cohort at any time by clicking the icon.
If you have the Accounts add-on, you can apply a group-level cohort instead of a cohort of users. When you select a specific group type, only the cohorts it contains will appear in the drop-down list on the right side of the equals sign:
You can also create a chart using the cohort directly from the Cohort page:
But before you can do any of that, you'll have to define a new cohort.
Define a new cohort
To define a new cohort, follow these steps:
- Click Create New > Cohort. This will take you to the a new cohort page, where you can set the parameters of a new cohort, upload a CSV of users into a new cohort, or create a prediction for a predictive cohort.
- You can click any of the conditions (performed event, had been active, had been new, had property, or had propensity) listed to begin defining your cohort. However, since this is a behavioral cohort, let's start by clicking ...performed event. You can add other conditions to your cohort definition later.
- Click Select event... and select the event you're interested in.
- Begin setting the parameters that will define your behavioral cohort:
First, tell Amplitude how you want it to count events. You have six options, all of which can be accessed from the with dropdown:
Count. Your cohort will be based on the number of times your event is triggered. For example, all users who triggered
Favorite Song or Videomore than five times during the last 30 days. See our Behavioral cohorts FAQ to learn more about how to create a cohort of users who lack user properties or did not perform an event.
Relative count. Amplitude will compare two different event frequencies. For example, all users who triggered
Play Song or Videoat a greater frequency than
Favorite Song or Videoduring the last 30 days. You have the option to add "where" clauses for both events under comparison.
Total sum of property. Filters for users who triggered events with a particular event or user property sum. These event or user properties must have numerical values. For example, all users in the last 30 days who triggered
Play or Search Songwith total
Durationvalue greater than 60 seconds.
- Distinct values of property. Filter for event or user properties down to a specific value or set of values you are analyzing. For example, only those users who favorited a song or video on more than one device.
- Historical count. Your cohort will contain users who performed the event a specific number of times, between one and five. See our Help Center article on how Historical Count works in Amplitude to learn more.
Count in interval. Filter for users who triggered the event at least once on each of the number of distinct days within a given interval. This enables you to specify behavior that occurred within distinct days in a defined time period. For example, you could filter for users who triggered the event at least once on each of a certain number of distinct days (you define how many) within a given interval. This differs from daily, weekly, or monthly behavior, which doesn't require the behavior to occur on different days.
See our Help Center article on how stickiness analysis works in Amplitude to learn more.
- Count. Your cohort will be based on the number of times your event is triggered. For example, all users who triggered
- Set the operator (equal to, greater than, less than, etc) and the value (i.e., the count value) of this parameter.
- Now you'll have to tell Amplitude when these events should have taken place. Here, too, you have some options, accessible from the any time dropdown:
- During. Includes all events triggered within the date range you choose in the date picker. This can be a range between two specific dates, or it can be something more dynamic, like Last 30 Days. In the latter case, the range will update every day, and users who have not triggered the event in X number of days will be dropped from the cohort.
- Since. Includes all events triggered since the calendar date you choose in the date picker.
- Within. Looks at events triggered within each cohort member's X days of first use. This is useful when you're interested in the group of users who triggered a specific event within X days of becoming a new user.
- You can add more events by clicking ...then and repeating the previous steps.
NOTE: Adding an event using ...then means users must trigger both events in that order to be included in the cohort. If you want to add another event without requiring users trigger them in a specific order, use + Add, as described in the next step.
- Next, you can add an ...or clause, or you can add another event, property, propensity, cohort or new user. To see your options for an Or clause, hover the cursor over the cohort definition you've built so far. To see your options for adding to your cohort definition, click + Add just below your current cohort definition.
When you add a condition using an Or clause, Amplitude will include users who meet either of those conditions. When you add to your cohort definition via + Add, Amplitude treats that as an And clause: A user must meet both conditions to be included in the cohort.
When you use + Add to add new components to your cohort, you can specify them for either inclusion or exclusion. Do this by selecting did not for events, user properties, and propensities; not part for cohorts; and had not been for new users.
Items meeting the exclusion condition will be excluded from the cohort, even if they meet all the other conditions you've specified.
In this example, the cohort is defined as users who've triggered the
Search Song event more than eight times, and also triggered the
Favorited a Song or Video event more than four times between April 1 to April 30, and are from the United States.
NOTE: For the most accurate results, put a date range around any user properties you include.
User property clauses
When you include a user property condition in a cohort, you're looking not at events, but at user properties. You're telling Amplitude that all users who had a specific value for a specific user property at a certain point in time should be included in your cohort. Properties and events are different things, and for that reason, the available options for the user property condition are different:
Most recently: This will select only users whose most recent value for the user property you're interested in matches the value you've specified. This value will be drawn from a user's most recent active event. This is useful if you have a user property where the values change frequently, but you want the cohort to look at the most recent value only. For example, you might want to only include users whose push notifications are enabled, since most new users (those in their first 30 days) will have them disabled at first.
NOTE: For numerical property values, Amplitude interprets a missing value as 0.
Any time: This will select users who had the specified value for the user property you're interested in at any time in the date range you select. For example, users who had the
Countryproperty of United States anytime during the last 30 days: Even if some users may have left the United States (which would mean their most recent
Countryproperty value is different), this cohort definition would still include them.
If you have instrumented group types, you can create group cohorts from the cohort detail page (where you define or upload a cohort). To do this, when defining your cohort, select the group name on the left side of the definition. In this example, the group name is "company(s)."
When applying the group cohort to a chart, add the group by clicking + Filter by, and then Cohort. Then select the group name from the list.
Group cohorts are compatible with all Amplitude chart types except Personas and Compass.
Create cohorts via Microscope
Microscope's Create Cohort option lets you create a cohort that contains all the users captured by the data point you selected. These are usually static cohorts. However, for some chart types (like basic retention and funnel analyses), you can still create behavioral cohort, though not all fields will be editable: static fields will be grayed out.
Microscope can also create a group cohort from a data point with groups applied.
Cohorts created from within Microscope will be static under the following scenarios:
- Composition with cross property values
- Retention if you have multiple returning events
- Usage interval view in retention
- Funnels with exclusion events
- Funnels that hold a property constant
- Funnels with Combine Events Inline
- Funnels with Compare Events at Step
- Distribution views in funnels (Time to Convert + Frequency)
- Event segmentation for properties (PropSum + PropAvg)
- Any chart depending on a different cohort
Import a cohort from a file
You can create a static cohort of users or groups by uploading a .CSV or text file of user IDs or Amplitude IDs. To do so, navigate to Cohorts & Audiences and click Import from CSV.
If you have the Accounts add-on, you can also create a cohort of groups. The file must contain one ID per line, and cannot contain any other text or extra spaces. The file size must be under 50MB.
If a user ID does not exist in Amplitude, it will simply be skipped, and that user will not be included in the cohort. If you are uploading Amplitude IDs, then all Amplitude IDs must be valid.
Your file should look like this:
A properly-formatted file has no header row, contains values only in the leftmost column, and does not include extraneous spaces or characters. The following is an example of an improperly-formatted file:
Once you select a file, specify whether the file contains Amplitude IDs, user IDs, or groups.
Re-import a cohort from a file
Manually uploaded cohorts can be re-imported. This lets you update your cohort in place, and avoid having to change all your charts to point to a new cohort.
Inline behavioral cohorts and interval cohorts
You can create simple behavioral cohorts directly within the Segmentation module of all Amplitude chart types except Compass. This lets you create a behavioral cohort in the context of a specific chart without having to navigate away from it and into the Behavioral Cohorts tab.
To do this, click + Performed.
Use this to filter your charts for users who have triggered certain events.
One difference between an inline cohort and one created via the Behavioral Cohorts tab is the existence of the in each clause. This lets you filter for users who have triggered the selected event a certain number of times within the time interval you specify, allowing you to create interval cohorts.
For example, this cohort would filter this Event Segmentation chart for users in the last four weeks who triggered
Download Song or Video at least three times in a given week:
Of those users, 143,793 downloaded three or more songs or videos during the week of January 9th and triggered the
Purchase Song or Video event.
Use inline cohorts to measure populations of cohorts over time. For example, say an important milestone in your product is playing five or more songs—each of which is longer than three minutes—in a single day. This is your highly engaged cohort.
From there, you can add additional where filters to specify event properties or user property conditions. By looking at this behavior in each interval, you can measure the population of your highly engaged cohort over time.
Compare your cohorts
The Cohort Comparison feature automatically compares your new cohort to all active users for the last 30 days. You can then choose a pre-existing cohort to compare it with, look at the overlap between two cohorts, choose user properties for side-by-side composition, compare actives, retention, average events, and more.
In the Behavioral Cohorts tab, click the title of a cohort to open the comparison analysis.
Manage your cohorts
You can mark cohorts you own as discoverable or unlisted. Discoverable cohorts can be found by any other user in your organization. Unlisted cohorts are only available to you, admins, managers, and people with a direct link to the cohort. Discoverable cohorts have a green globe icon while unlisted cohorts have a grayed-out toggle.
Archive a cohort
You can archive a cohort by clicking More —> Archive. If you accidentally archive the wrong cohort, click More to get the Unarchive option.
Delete a cohort
Only the owner of a cohort can archive and delete a cohort.
To delete a cohort, you will have to archive it first. Once you have archived the cohort, you must confirm the cohort is to be permanently deleted before Amplitude will remove it
Transfer ownership of a cohort
You can transfer ownership of cohorts you own to others in your organization. Alternatively, you can also add additional owners of a cohort. Admins and managers can transfer ownership of other people's cohorts, as well as add additional owners to a cohort.
For admins and managers, click into the behavioral cohort and then click Share in order to transfer ownership of a cohort.
Sync or export your cohorts
To export a cohort as a .CSV file, click Export CSV. You will receive an emailed link to download a .CSV file containing all users in a cohort and their most recent user properties.
While cohort export for portfolio projects is supported for all destinations, when you select Amplitude User Property, only
user_id will be available.
Refresh a cohort
You can manually refresh a cohort from the Cohort detail view, in the top navigation bar. This will update the cohort's most recent user count.
For any chart or query that segments on a cohort, the segmented cohort will automatically recompute itself whenever the chart is generated. Otherwise if the cohort is not included in a chart, it will not recompute unless manually recomputed.