You're running A/B tests or analyzing retention, but you're working with everyone instead of the users who actually matter. Behavioral cohorts in Amplitude let you define user groups based on what they actually do — not just demographics. Once set up, you can analyze them separately, target them for experiments, or sync them to your other tools.
Understanding Behavioral Cohorts in Amplitude
A behavioral cohort is a group of users defined by their actions and properties, not static traits. In Amplitude, cohorts combine event patterns, user properties, and temporal conditions to identify your most important user segments.
Step 1: Identify the Behavior That Matters
Start by deciding what behavior defines your cohort. Ask: Are these users who completed a specific action? Who have a property set to a certain value? Who match a sequence of events? In Amplitude, cohorts work with events you're already tracking via the track method, so the events need to exist in your data.
// Track the behaviors that will define your cohort
amplitude.track('Feature_Viewed', {
feature_name: 'advanced_reporting',
timestamp: Date.now()
});
amplitude.track('Export_Initiated', {
export_type: 'csv',
data_range: '30d'
});Step 2: Navigate to Cohorts in Amplitude
In the Amplitude dashboard, go to Analytics > Cohorts. Click Create Cohort. You'll see options to build a rule-based cohort using events, user properties, or a combination. Amplitude uses an AND/OR logic system — you can chain conditions together.
// Your event tracking should capture the properties needed for cohort rules
amplitude.track('Subscription_Started', {
plan_type: 'enterprise',
annual: true,
company_size: '1000+'
});Define Cohort Rules in the Amplitude Dashboard
Building a cohort rule means specifying conditions: events happened, properties match values, or sequences occurred. The Amplitude UI guides you through this with a visual builder.
Step 1: Add Event-Based Conditions
Click Add Group and select Event. Choose the event name (e.g., Feature_Viewed), then set conditions on its properties (e.g., feature_name equals "advanced_reporting"). You can require the event to have happened within a time window (last 30 days, last 6 months, all time). Use Match ANY event in the group if multiple event types qualify, or Match ALL events if you need a specific sequence.
// Example: Events you'd use to define a cohort
// Users who viewed advanced reporting within the last 30 days
amplitude.track('Feature_Viewed', {
feature_name: 'advanced_reporting'
});
// AND have triggered an export in that same window
amplitude.track('Export_Completed', {
export_type: 'csv'
});Step 2: Add Property-Based Conditions
Click Add Group and select Property. Choose a user property (e.g., plan_type) and set a condition (equals, contains, greater than, etc.). This filters by static or derived user attributes. Combine multiple property conditions with AND/OR logic — for example, (plan_type = "enterprise" OR plan_type = "team") AND active_subscription = true.
// Set user properties that will be used in cohort filters
amplitude.setUserProperties({
plan_type: 'enterprise',
active_subscription: true,
company_size: '1000+',
onboarding_completed: true
});Step 3: Save and Name Your Cohort
Give your cohort a descriptive name (e.g., Enterprise Users with Advanced Reporting Access). Amplitude will calculate the cohort size — you'll see how many users match your rule. Click Save Cohort and it's ready to use in charts, segments, and downstream tools.
// Once your cohort is created, you can use it in Amplitude's API
// to query cohort metadata and configuration
fetch('https://api.amplitude.com/2/cohorts', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}).then(res => res.json())
.then(data => console.log('Cohorts:', data));Use Cohorts in Analysis and Downstream Tools
Once your cohort is saved, you can segment your analysis by it, target it in experiments, or sync it to downstream tools like your email platform or data warehouse.
Step 1: Segment Charts and Reports by Cohort
In any Amplitude chart (funnel, retention, user sessions), click Segment and add your cohort as a dimension. You'll instantly see how that user group behaves differently — retention rates, conversion funnels, feature adoption, whatever metric you're measuring. This is where cohorts prove their value: comparing behavior across groups.
// Set user identity so Amplitude can match this user to cohorts
amplitude.setUserId('[email protected]');
amplitude.setDeviceId('device-id-123');
// Track events — Amplitude automatically matches the user to cohorts
// based on their properties and historical behavior
amplitude.track('Page_Viewed', {
page: '/dashboard'
});Step 2: Export or Sync Cohorts to External Tools
Amplitude lets you export cohorts via API or sync them to destinations like Segment, Salesforce, HubSpot, or S3. In the cohort details, click Sync and choose your destination. This lets you activate the cohort — for example, send a targeted email to Enterprise users, or load them into your data warehouse for custom analysis.
// Query cohort metadata via the Amplitude API
// Useful for building custom workflows or exports
fetch('https://api.amplitude.com/2/cohorts/{cohort_id}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}).then(res => res.json())
.then(cohort => {
console.log('Cohort name:', cohort.name);
console.log('User count:', cohort.size);
});Common Pitfalls
- Creating cohorts on events you haven't implemented yet. Always verify your events are firing in Amplitude before building cohorts on them — use the Events > Live Events view to double-check.
- Setting cohort time windows too narrow. If you require an event in the last 7 days but users only do that action monthly, your cohort will be nearly empty. Test your rule logic with Preview before saving.
- Forgetting that cohort membership is dynamic. Syncing a cohort to an external tool captures a snapshot, but Amplitude's cohort evolves as user behavior changes. Set up periodic re-syncs or use Amplitude's integrations instead of one-time exports.
- Using cohorts without checking the match count. A cohort matching zero or five users might indicate your rule is correct but your behavior is rare, or it could mean your conditions are impossible. Always validate cohort size before relying on it for analysis.
Wrapping Up
Behavioral cohorts transform how you analyze your product. Instead of looking at everyone, you focus on the users who exhibit the behaviors that matter to your business — high-value customers, engaged beta testers, churn-risk users, whatever you define. Once set up, segment all your Amplitude reports by them, run experiments on them, or sync them to tools downstream. If you want to track behavioral cohorts automatically across Amplitude and your other tools without manual setup each time, Product Analyst can help.