Mixpanel doesn't have a built-in "churn rate" metric—you need to calculate it from retention data. The key insight: churn is simply 100% minus your retention rate. We'll show you how to track explicit churn events and use Mixpanel's Retention Insights to spot patterns in who's leaving and why.
Track Churn Events in Your Product
Before you can visualize churn, define and track when users actually churn. This is usually a subscription cancellation, account deletion, or explicit action that signals a user is leaving.
Define Your Churn Event
Churn happens at a specific moment—when a subscription cancels, an account gets deleted, or a user downgrades to free. Pick one clear event that represents churn in your business. If you offer multiple plans or use cases, you might track churn differently per segment (e.g., subscription_cancelled for SaaS, account_deleted for B2C).
// Track when a subscription is cancelled
mixpanel.track('Subscription Cancelled', {
'plan_type': 'professional',
'monthly_spend': 299,
'tenure_days': 180,
'cancellation_reason': 'too_expensive'
});
// Or track account deletion
mixpanel.track('Account Deleted', {
'account_value': 500,
'days_active': 45,
'deletion_type': 'self_service'
});Implement the SDK and Send Events
Use the Mixpanel JavaScript SDK to send churn events from your frontend or backend. Initialize the SDK with your token and send events whenever users perform churn actions. Include enough context (plan type, customer segment, tenure) so you can slice churn data later.
import * as Mixpanel from 'mixpanel-browser';
Mixpanel.init('YOUR_PROJECT_TOKEN');
const handleCancellation = async (userId, planType) => {
Mixpanel.identify(userId);
Mixpanel.track('Subscription Cancelled', {
'plan_type': planType,
'days_subscribed': calculateTenure(userId),
'mrr_lost': getPlanMRR(planType)
});
};Validate Events in Live View
In Mixpanel, navigate to the Data section and open Live View. Trigger a churn event in your product and verify it appears within seconds. Check that the event name and properties match your code—this catches typos and missing context early.
// Test event to verify tracking is working
mixpanel.track('Subscription Cancelled', {
'test': true,
'plan_type': 'starter'
});Build a Retention Report to Measure Churn
Retention Insights show what percentage of a cohort returns after an initial event. Since churn is the inverse, you can see exactly when and why users stop coming back.
Create a Retention Report
Go to Insights > Retention in Mixpanel. Click Create Report. A retention report shows cohorts of users grouped by their first event date and what percentage return within each time interval. If 60% of a cohort returns, 40% churned.
// Track the starting point for your retention cohort
mixpanel.track('Subscription Started', {
'plan_type': 'professional',
'billing_cycle': 'monthly',
'source': 'sales_team'
});
// Track engagement to measure retention
mixpanel.track('Invoice Paid', {
'amount': 299,
'plan_type': 'professional'
});Configure Cohort and Return Events
Select Subscription Started as the Initial Event that defines cohorts. Choose Invoice Paid (or any action indicating active use) as the Return Event. Mixpanel automatically calculates what percentage of each weekly or monthly cohort returned over time.
// Set user properties for deeper segmentation
mixpanel.people_set({
'plan_type': 'professional',
'annual_contract': false,
'customer_segment': 'mid_market',
'mrr': 299
});
mixpanel.track('Invoice Paid', {
'plan_type': 'professional'
});Segment by Plan Type or Customer Segment
In your Retention report, click Segment and choose a property like plan_type or customer_segment. Mixpanel shows separate retention curves for each segment. If your Pro plan has 30% churn while Starter has 15%, that's critical insight for product decisions.
Analyze Churn Patterns with Event Segmentation
For a granular view of who's churning and why, create an Insights report filtered by your churn event. Segment by user properties to see which customers are most at risk.
Create an Event Count Report
Go to Insights > Events. Select your churn event (e.g., Subscription Cancelled). This shows a timeline of churn events over days or weeks. The raw count isn't the churn *rate*, but the trend tells you if churn is accelerating.
// Track detailed churn context for filtering later
mixpanel.track('Subscription Cancelled', {
'plan_type': 'professional',
'previous_annual_value': 3588,
'days_subscribed': 180,
'last_login_days_ago': 7,
'churn_reason': 'feature_gap',
'engagement_score': 2
});Segment by Plan, Tenure, or Engagement
Click Segment By and choose a property like plan_type, tenure_days, or engagement_score. You'll now see churn events split by segment. Combine with a separate count of total active subscribers to calculate churn *rate* for each segment.
// Track engagement metrics to identify at-risk cohorts
mixpanel.people_set({
'last_active_date': new Date().toISOString(),
'days_since_last_action': 30,
'features_used': ['analytics', 'exports'],
'support_tickets': 5
});
mixpanel.track('Subscription Cancelled', {
'days_since_last_action': 30,
'support_tickets': 5
});Export and Calculate Churn Rate
Click Export to download your segmented churn events as CSV. Combine with an export of active subscribers to calculate true churn rates: (Churned Users / Starting Users) × 100%. This gives precise churn percentages per plan or cohort.
Common Pitfalls
- Confusing retention rate with churn rate. Churn = 100% - retention. If retention is 70%, churn is 30%.
- Not including enough context in churn events. Without plan type, tenure, or engagement metrics, you can't segment churn to find patterns.
- Mixing event counts with unique user counts. Ten churn events might come from five users with two events each. Always count unique users for true churn rate.
- Forgetting that subscription churn (cancellation) is different from engagement churn (stopped using). Track both separately if your product has free and paid tiers.
Wrapping Up
You now have three ways to visualize churn in Mixpanel: tracking explicit churn events, building retention reports to show cohort decay, and analyzing churn patterns by customer segment. The retention report is the fastest path to a churn rate number, while detailed churn events let you dig into why customers are leaving. If you want to track this automatically across tools, Product Analyst can help.