Behavioral cohorts group users based on actions they've taken—like viewers who abandoned pricing, or users who returned three times in a month. To build reliable cohorts in Amplitude, you need clean, consistent event tracking from the start. Without it, your cohort rules become brittle and your analysis unreliable.
Track Events That Will Define Your Cohorts
Cohorts in Amplitude are built on events. Start by identifying which behaviors matter and ensuring you're capturing them with consistent property names.
Send events from your application
Initialize the Amplitude SDK and call track() for each behavior you want to use in cohort rules. Include relevant properties so you can filter by specifics later.
import * as amplitude from '@amplitude/analytics-browser';
// Initialize
amplitude.init('YOUR_API_KEY', {
userId: '[email protected]',
});
// Track a page view
amplitude.track('Page Viewed', {
page_name: 'pricing',
referrer: 'email',
});
// Track a feature interaction
amplitude.track('Feature Used', {
feature_name: 'export_report',
export_format: 'csv',
});Use consistent property names and values
Amplitude cohorts match on exact property values. If you sometimes send page_name: 'Pricing' and sometimes page_name: 'pricing', your cohort rule won't catch both. Document your naming scheme.
// CONSISTENT (good)
amplitude.track('Page Viewed', { page_name: 'pricing' });
amplitude.track('Feature Used', { feature_name: 'pricing_calculator' });
// INCONSISTENT (will break cohorts)
amplitude.track('Page Viewed', { page: 'pricing' }); // Different property key
amplitude.track('Feature Used', { feature_name: 'Pricing Calculator' }); // Different casingDistinguish between event and user properties
Use track() for context about that specific action (what happened, when). Use setUserProperties() for attributes that persist (plan tier, signup date). Cohorts can use either, but user properties are useful for quick filtering.
// Event properties: specific to this action
amplitude.track('Button Clicked', {
button_id: 'pricing_cta',
section: 'hero',
});
// User properties: persist across events
amplitude.setUserProperties({
plan_tier: 'free',
signup_date: '2025-06-15',
employee_company: 'acme',
});Build Your Cohort in Amplitude's UI
Once your events are flowing, you can define cohort membership rules using the events you're tracking.
Navigate to Cohorts and create a behavioral rule
In the Amplitude dashboard, go to Analytics > Cohorts and click Create Cohort. Select Event-based (not property-based) to build rules around user actions.
Define membership criteria using event conditions
Specify which events users must (or must not) have triggered, with optional property filters and time windows. For example: 'Visited Pricing Page in the last 30 days AND has NOT completed Purchase.'
// This is how your cohort rule would be expressed in Amplitude's builder:
// Condition 1: Event 'Page Viewed' where page_name = 'pricing' (last 30 days)
// AND NOT
// Condition 2: Event 'Purchase Completed' (any time)
// Once the cohort exists, optionally set it as a user property for easier access
amplitude.setUserProperties({
cohort_pricing_abandoners: true,
cohort_last_updated: new Date().toISOString(),
});Preview and validate the cohort
Click Preview to see how many users match your rule. If the preview shows 0% or 100% of your user base, double-check your event tracking—this usually means data isn't flowing as expected.
Save and activate
Name the cohort clearly, like pricing_page_viewers_non_purchasers_30d. Save it. Once active, it's available as a Segment By filter in charts, funnels, and other analyses.
Use Your Cohort in Analysis and Iterate
Now that your cohort is live, segment your analytics and refine your tracking based on what you learn.
Segment charts by your cohort
In any Amplitude chart (retention, funnel, event segmentation), add Segment By > Cohorts and select your cohort. Compare metrics for cohort members vs. non-members.
Store cohort membership as a user property for consistency
Instead of recalculating cohort membership in every chart, explicitly set it as a user property. This makes filtering faster and ensures consistency across analyses.
// When a user qualifies for your cohort, tag them
if (userViewedPricingAndDidNotPurchase) {
amplitude.setUserProperties({
in_pricing_abandoners_cohort: true,
cohort_qualification_date: new Date().toISOString(),
});
}
// Later in Amplitude UI: Filter by in_pricing_abandoners_cohort = trueMonitor cohort quality and adjust criteria
If your cohort is too broad (almost everyone qualifies) or too narrow (very few members), revisit your event tracking. Add more specific properties or change time windows.
Common Pitfalls
- Tracking event properties with inconsistent naming or casing—Amplitude's cohort builder is literal, so 'pricing_page' and 'Pricing Page' are completely different.
- Building time-relative cohorts without remembering they're dynamic—users enter and exit 'last 30 days' cohorts as time advances, making historical comparisons tricky.
- Neglecting to check the cohort preview before activation—a cohort matching 0% or 100% of users usually means your event data isn't flowing or your rule is broken.
- Mixing behavioral and property-based cohort thinking—behavioral cohorts require specific events to have fired; property cohorts filter on static user attributes. Don't confuse the two.
Wrapping Up
Behavioral cohorts in Amplitude let you segment users by what they actually do, not just who they are. Build them on solid event tracking with consistent property names, validate them in the preview, and use them to segment your analysis. If you want to track this automatically across tools, Product Analyst can help.