This article will help you:
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 fired 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:
- From the left-hand sidebar, click 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.
- From the ...performed dropdown, select the event you're interested in.
Once you've selected an event, you can begin setting the parameters that will define your behavioral cohort.
First, you'll have to tell Amplitude how you want it to count events. You have five 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 fired. For example, all users who fired
Favorite Song or Videomore than five times during the last 30 days.
- Relative count. Amplitude will compare two different event frequencies. For example, all users who fired
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 fired 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 fired
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. Your cohort will be based on the number of times your event is fired. For example, all users who fired
- 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 fired 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 fired the event in X number of days will be dropped from the cohort.
- Since. Includes all events fired since the calendar date you choose in the date picker.
- Within. Looks at events fired within each cohort member's X days of first use. This is useful when you're interested in the group of users who fired a specific event within X days of becoming a new user.
- Next, you can add more events or other conditions, with an And also / And not who clause or an Or clause. Hovering the cursor over the cohort definition you've built so far will bring up your options for an Or clause; your options for adding an And also / And not who clause are visible 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 use an And also clause, a user must meet both conditions to be included in the cohort. Using the And not who clause will exclude users who meet that condition 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 fired the
Search Song event more than eight times, and also fired 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 the ...had 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 ...had 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 "account_id(s)."
When applying the group cohort to a chart, select the group name from the ...performed by dropdown menu.
Group cohorts are compatible with all Amplitude chart types except Personas and Compass. Also, nested behavioral cohorts are not supported.
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 with constant property group-bys
- 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. The file must contain one ID per line, and cannot contain any other text or extra spaces.
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.
The file size must be under 50MB.
Once you select a file, specify whether the file contains Amplitude IDs or user IDs.
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 way, you can 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 +perform.
Use this to filter your charts for users who have fired 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 fired 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 fired
Download Song or Video at least three times in a given week:
Of those users, 162,508 downloaded three or more songs or videos during the week of December 9th and fired 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. alternately, 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.
To transfer ownership or add additional owners to a cohort, hover over the Share section in the cohort and select Modify Ownership from the drop-down.
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
Amplitude Recommend customers can sync behavioral cohorts with a partner integration. Simply click Sync to... and select the integration from the list. The exported cohort has a maximum capacity of 1 million users.
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.
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.