Skip to content

Cohorts

A cohort is a named group of persons defined by conditions, evaluated ahead of time. One cohort definition serves the whole platform: feature flag targeting, campaign audiences and analysis.

Two kinds, combined with AND:

  • Trait conditions — on the person’s current properties: plan exact "pro", company icontains "acme".
  • Behavior conditions — “did event X at least N times in the last Y days”: checkout ≥ 3 times in 30 days. Behavior counting resolves identity merges, so a user’s activity across devices counts as one person.

Cohort membership is precomputed: definitions are evaluated on a schedule (about every 10 minutes) and the member list is swapped atomically — consumers never observe a half-built cohort.

What that buys and costs:

  • Flag evaluation and campaign matching read membership as a simple lookup — no heavy queries in hot paths, so /decide stays fast no matter how complex your cohort definitions get.
  • Membership can be up to ~10 minutes stale. For flags and campaign audiences that’s the right trade; cohorts are not a real-time primitive. If you need an immediate targeting override for one evaluation, pass person_properties to /decide.

Cohorts live in the panel next to feature flags. Like flags, they’re settings-grade: any project member can view them, changing them requires an admin role — a cohort edit can change who receives a campaign.