/

Behavioral cohorts

This article covers some frequently asked questions about Behavioral Cohorts.

How do I group users with a certain property value that was recently introduced?
To create a cohort of these users, you can use the most recently feature. This finds users who had a certain property value on their most recent active event in the time frame given.

For example, here Amplitude is querying for users who most recently had "Germany" as the value for the country user property in the last 30 days:

Why does the .CSV file keep failing when uploading a list of users to create a cohort?
The .CSV file may only contain one field with values:

  • The file can contain either the user IDs or Amplitude IDs, but not both.
  • It must not contain blank space or other text.

If the file isn't in the correct format, Amplitude shows an error message and doesn't upload the cohort. Read more about uploading .CSV files as cohorts.

A properly-formatted .CSV file looks like this:

Screen_Shot_2021-07-07_at_10.05.11_AM.png

Why is the cohort definition non-modifiable?
While you can create cohorts from certain charts, particularly retention charts, you can't to modify the events from within these cohorts. In this example, the steps are present, but not modifiable. To change them, return to the source of the chart, change the steps there, and recreate a new cohort.

Screenshot

Why doesn't this cohort support population over time?
Cohort population is only supported for dynamic cohorts, for example, cohorts that can be recomputed according to specified criteria. It's not supported for static cohorts. Examples of static cohorts include those imported from a .CSV file or created using Microscope within charts.

How do I create a cohort of users who fired an event a specific number of times in the last 30 days? The count feature in cohorts allows you to segment these users. The following cohort definition segments users who fired Play Song or Video ten times or more in the last 30 days.

Screenshot

How can I identify users who lack user properties or didn't perform events?
You can create a custom definition of a group of users based on not only the events they have performed, but also events which they didn't perform.

Note

Amplitude doesn't process queries that include Count = 0 or Count < 1. All such queries return zero users.

To identify users who did perform a particular event or who lack a particular property, follow one of the processes described below.

Identify users who were on product in the last 30 days but didn't complete Event A

In this example, AmpliTunes is the product, and Favorite Song or Video is the key event of interest. To create this cohort, use the didn't clause, which exists as an option when you add a second event to your cohort.

behavioral_cohorts_faq_0.png

This excludes users who triggered Favorite Song or Video at least once in the last 30 days. This also helps identify users who haven't triggered this event.

Identify users who lack a particular user property in the last 30 days

Another common scenario is identifying all the active users who didn't become a paying user at any point during the last 30 days. To do this, use the didn't clause.

behavioral_cohort_faq_1.png

Instead of identifying users who have Paying = false at any time in the last 30 days, identify users who didn't have Paying = true during that same time frame. 

If a user wasn't a paying user at the start of the month but became a paying user by end of this month, querying for users who have Paying = false at any time in the last 30 days identifies them. Read on for more information about cohorts in Amplitude.

How do I export a cohort with only user IDs or specific user properties?
You can use Amplitude's Behavioral Cohort API to download a cohort with only user IDs or specific user properties. Downloading a cohort via this API happens in three steps:

  1. Request a single cohort.
  2. Poll the cohort status.
  3. Download the file.

In step 1, when you set the props parameter to 0, the download will only include Amplitude ID and User ID. When props = 1, the download includes all user properties.

If you want to export specific user properties, set props = 1 and add the desired user properties in the propKeys parameter. See the example below.

1curl --location --request GET 'https://amplitude.com/api/5/cohorts/request/26umsb5?props=1&propKeys=Property1&propKeys=Property2' --header 'Authorization: Basic MTIzNDU2NzgwMDoxMjM0NTY3MDA='

Was this page helpful?

Thanks for your feedback!

July 2nd, 2024

Need help? Contact Support

Visit Amplitude.com

Have a look at the Amplitude Blog

Learn more at Amplitude Academy

© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.