You know how many users signed up, but do you know how many came back? Retention analysis tells you whether your product actually keeps people. Mixpanel's Retention report groups users by a starting event (cohort), then tracks what percentage return to perform another action on subsequent days, weeks, or months.
How Retention Analysis Works in Mixpanel
Retention analysis answers one question: Of the users who did X on day 0, what percentage did Y by day 1, 2, 3, and so on?
Understand the Cohort (Starting Event)
A cohort is a group of users who performed a specific action on the same day. In Reports > Retention, you define this as your initial event. Common examples: user_signup, app_opened, or premium_purchased. All users who triggered this event on a given date become day-0 cohort members.
// Track when a user signs up (creates a day-0 cohort member)
mixpanel.track('user_signup', {
signup_source: 'website',
plan_type: 'free'
});
// Track when a premium user is created (alternate cohort)
mixpanel.track('premium_purchased', {
revenue: 99.99,
billing_cycle: 'annual'
});Define the Return Event
The return event is what you measure to see if users stayed engaged. This might be account_login, feature_used, or invoice_paid. Mixpanel calculates what fraction of your day-0 cohort performed this return event on day 1, day 2, etc. You're looking for the percentage curve.
// Track repeated usage (measures retention)
mixpanel.track('account_login', {
login_method: 'email',
device_type: 'mobile'
});
mixpanel.track('feature_used', {
feature_name: 'export_report',
time_on_feature: 45
});Read the Retention Table
Open Reports > Retention and configure your initial and return events. Mixpanel shows a table where rows are cohorts (by date) and columns are days elapsed. Each cell is the percentage of that cohort that returned. A 40% value in day-7 means 40% of your day-0 users came back on day 7.
Creating a Retention Report in Mixpanel
Once your events are tracked, building a retention report takes minutes.
Navigate to the Retention Report
In your Mixpanel project, go to Reports > Retention. You'll see a blank report template with dropdown menus for Initial Event and Return Event.
Select Your Initial Event and Return Event
Click the Initial Event dropdown and choose the event that defines your cohort. For a mobile app, this might be app_install. For SaaS, account_created. Then select your Return Event—something that indicates active use, like first_report_generated or dashboard_opened. Don't use the same event for both.
// During onboarding, track the initial event that defines your cohort
mixpanel.identify(userId);
mixpanel.track('account_created', {
plan: 'starter',
industry: 'saas',
company_size: '10-50'
});
// Set persistent properties for later segmentation
mixpanel.register({
'signup_date': new Date().toISOString(),
'initial_plan': 'starter'
});
// Later, track the return event
mixpanel.track('dashboard_opened', {
days_since_signup: 3,
session_count: 5
});Add Property Filters and Choose Time Windows
Use the Filter option to narrow your cohort. You can filter by properties: show retention only for users who signed up on plan = premium, or country = USA. Set Cohort Period (daily, weekly, or monthly) and Time Interval (days, weeks, or months). For B2B, weekly cohorts tracked over weeks works well.
// Track properties used in filters
mixpanel.track('account_created', {
plan: 'premium', // Can filter retention by this
country: 'US', // Or by this
source: 'organic', // Or by this
annual_revenue: 100000
});
// Maintain consistent property names across events for segmentation
mixpanel.track('dashboard_opened', {
plan: 'premium', // Tie back to initial properties
country: 'US'
});Practical Retention Patterns and Pitfalls
Distinguish First from Return Actions
Make sure your initial event and return events are distinct. Use first_session as the initial event and return_session as the return event. This prevents day-0 retention from inflating to 100% and makes the metric actually useful.
// On app launch, determine if this is the first session
const isFirstSession = localStorage.getItem('has_launched') === null;
if (isFirstSession) {
mixpanel.track('first_session', {
platform: 'web',
utm_source: document.referrer
});
localStorage.setItem('has_launched', 'true');
} else {
// Return session (could be day 1, 7, 30, etc.)
mixpanel.track('return_session', {
days_since_signup: calculateDaysSinceSignup(),
session_count: getSessionCount()
});
}Use Segmentation to Find Healthier Cohorts
Segment by properties to understand which user types stick around. Compare retention between source: 'organic' vs source: 'paid'. Compare industry: 'fintech' vs industry: 'ecommerce'. A cohort with 60% day-7 retention versus 30% in another tells you which segment is actually healthy.
Watch for Survivor Bias
If your return event is premium_subscription_renewed, you're measuring retention only among paying users. If you want true product retention, use a lower-friction event like logged_in or feature_accessed. Use higher-friction events to measure revenue retention separately.
Common Pitfalls
- Setting return event = initial event. Day-0 retention will be 100% and the metric becomes useless.
- Not tracking properties on signup. You can't segment retention curves later if you don't know plan type, source, or industry.
- Confusing retention % with absolute count. 50% retention on 10 users is not the same as 50% on 1000. Check cohort size.
- Ignoring the time window mismatch. A weekly cohort period tracked over daily intervals can show noise. Match your cohort period to your product's usage cycle.
Wrapping Up
Retention analysis in Mixpanel tells you whether your product keeps users. Define a cohort with an initial event, pick a return event that signals real engagement, segment by properties to find patterns. High retention day-1 but steep drop-off by day-7? Activation problem. Flat 40% from day-1 onwards? You've built habit-forming behavior. If you want to track retention automatically across all your tools and get alerts when it drops, Product Analyst can help.