dDatahopdocs
People

Cohorts

Build dynamic and static cohorts and use them in insights, flags, experiments and feedback.

A cohort is a named group of people, such as power users, new users, enterprise accounts or repeat customers. Define it once and reuse it everywhere: as a filter, a breakdown, a flag target or an experiment segment.

DynamicStatic
Who's inEveryone who matches your rulesA fixed list you add people to
Changes on its ownYes. People join and leave as they behave.No
Good for"Ordered at least twice in 90 days"Beta testers, a list from sales

You choose the type when you create the cohort, and you can't change it later.

Build a dynamic cohort

People → Cohorts → New cohort. Name it, keep the type on Dynamic, and choose whether people must match All or Any of your rules. Rules come in three kinds:

  • Person property: country equals DE, plan is one of pro, business, company_size is set.
  • Behaviour: performed (or did not perform) an event at least N times in the last N days. Click Total of a property to add a sum, such as total amount ≥ 500. You can also limit which events count, such as only currency = EUR.
  • Cohort: in or not in another cohort.

Save with Create cohort (or ⌘S). The size panel shows how many people match and when it was counted. Click recalculate to refresh it.

Some examples:

CohortRules
Power usersPerformed project_opened at least 20 times in the last 14 days
New usersPerformed signed_up in the last 7 days
Repeat customersPerformed order_completed at least 2 times in the last 90 days
Big spendersPerformed order_completed with total amount ≥ 500 in the last 90 days
Lapsed customersPerformed order_completed in the last 365 days, and did not perform it in the last 60 days
Enterprise accountsPerson property plan equals enterprise

Time windows are counted back from today, so membership changes over time. A power user who stops logging in drops out after 14 days.

Combine cohorts to keep rules short. For example, build New power users as in Power users and in New users. A cohort can't include itself.

Build a static cohort

Choose Static when you create it, and paste the initial members: one email or id per line. You can paste a spreadsheet column, because commas and tabs also work. People who can't be found are skipped.

Later, use Add people to paste more, remove people from the member list, or click Add to cohort on someone's profile.

Build a cohort from SQL

When a rule is easier to say in SQL, write it once in the SQL editor and save it. The query needs a person_id column:

SELECT person_id
FROM events
WHERE event = 'order_completed'
GROUP BY person_id
HAVING count() >= 3 AND max(timestamp) > now() - INTERVAL 30 DAY

Then either choose SQL when you create a cohort and pick the query, or open the query and use ⋯ → Use with people → Create cohort. Members are the people the query returns. They're recalculated every hour, whenever the query changes, and when you click recalculate. A SQL cohort works everywhere other cohorts do.

Use a cohort

WhereHow
InsightsAnalyse on the cohort page opens a trend for its members. In any insight, filter by cohort or break down by cohorts to compare them.
AgentsAsk about one cohort, for example "which pages do repeat customers land on?" Agents can filter any query, including web analytics, by cohort.
Feature flagsTarget a flag at the cohort, or at everyone not in it. See Feature flags.
ExperimentsReport results per cohort. See Segments.
FeedbackRead only what one cohort is saying.
PeopleFilter the persons list to the cohort.

Editing a cohort's rules applies everywhere from the next chart on. Flags pick up membership changes within about five minutes.

Delete a cohort

Use the ⋯ menu. A cohort that an experiment reports on can't be deleted, so remove it from the experiment first. Filters and flag rules that used a deleted cohort match nobody.

On this page