Funnel analysis shows where users drop off during critical flows like sign-ups, purchases, or onboarding. Mixpanel's funnel feature lets you define a sequence of events and see exactly how many users complete each step—and more importantly, where they abandon.
Instrument Events for Your Funnel
Before you can analyze a funnel, you need to track the events that make up each step. Use mixpanel.track() to record user actions at each stage.
Track the funnel entry point
Start tracking the beginning of your user journey. For a sign-up flow, this might be when a user lands on your sign-up page or clicks the Sign Up button. Use mixpanel.track() with a descriptive event name and relevant context.
// Track when user views the sign-up page
mixpanel.track('Sign Up Started', {
'source': 'landing_page',
'campaign': 'spring_2024'
});Track intermediate funnel steps
Add events for each step in your user flow. If your sequence is view sign-up → enter email → confirm email → complete profile, track each transition. Include properties that help you segment behavior later.
// Email entered
mixpanel.track('Email Entered', {
'email_domain': extractDomain(email)
});
// Email confirmed
mixpanel.track('Email Confirmed');
// Profile completed
mixpanel.track('Profile Completed', {
'account_type': 'individual'
});Track the final conversion event
Define the last step clearly. For sign-up funnels, this is typically when the user's account is fully created and active. Use a consistent event name across your analytics team.
// Account fully activated
mixpanel.track('Sign Up Completed', {
'user_id': userId,
'signup_duration_seconds': elapsedTime,
'method': 'email'
});Build Your Funnel in Mixpanel
Once your events are flowing into Mixpanel, create the funnel report to visualize the user journey and drop-off rates.
Open the Funnels report
From your Mixpanel project, navigate to Reports > Funnels. Click Create Funnel to start a new funnel analysis.
// Query funnel data via Funnels API
const axios = require('axios');
const response = await axios.get('https://mixpanel.com/api/2.0/funnels', {
params: {
'project_id': YOUR_PROJECT_ID,
'from_date': '2024-03-01',
'to_date': '2024-03-31',
'funnel_id': FUNNEL_ID,
'interval': 1
},
auth: {
username: YOUR_USERNAME,
password: YOUR_API_SECRET
}
});
console.log(response.data);Select your funnel steps in order
Click Add Step and select your first event. Mixpanel shows all tracked events. Add your entry-point event, then each successive step in order. The funnel always flows top to bottom.
// Funnel steps (in sequence):
// Step 1: Sign Up Started
// Step 2: Email Entered
// Step 3: Email Confirmed
// Step 4: Sign Up Completed
// Mixpanel matches these by user_id and event timestamp.
// A user must complete steps in this order to be counted.Apply segments to focus your analysis
Optionally segment by user properties (e.g., traffic source, plan type) or event properties. This isolates behavior for specific cohorts. For example, compare sign-up completion between organic and paid traffic.
// Use the Data Access API to query funnels with segments:
const funnelQuery = {
'funnel_id': 12345,
'from_date': '2024-03-01',
'to_date': '2024-03-31',
'on_properties': [
{'name': 'source', 'operator': '==', 'value': 'paid'}
]
};
// Returns funnel data for only paid traffic usersAnalyze and Optimize Your Results
Once your funnel is built, examine drop-off rates at each step and use those insights to improve conversion.
Review conversion rates and identify drop-off
The Funnels report shows absolute user count and percentage conversion at each step. Identify the step with the biggest drop-off—that's your optimization target. Hover over each bar for detailed numbers.
// Example API response:
{
"funnel_id": 12345,
"data": {
"2024-03-26": [
{"event": "Sign Up Started", "count": 5000},
{"event": "Email Entered", "count": 4200}, // 84%
{"event": "Email Confirmed", "count": 3500}, // 83%
{"event": "Sign Up Completed", "count": 2800} // 80%
]
}
}
// Overall conversion: 5000 → 2800 = 56%Break down results by user segments
Use Breakdowns in the UI to split results by user or event properties. For example, break down by traffic source, device type, or account plan. This reveals which segments underperform.
// Query Mixpanel to break down funnel by traffic source:
const breakdownQuery = {
'funnel_id': 12345,
'breakdown': 'utm_source',
'from_date': '2024-03-01',
'to_date': '2024-03-31'
};
// Returns conversion rates split by source:
// organic: 58% conversion
// paid: 48% conversion
// direct: 62% conversionFilter to specific user populations
Use the Segments panel to drill into a specific cohort. Focus on users from the last 7 days, or only mobile app users. This narrows your analysis to the population you want to improve.
// Add segment filters in the Funnels UI:
// Device Type = 'Mobile' AND Country = 'US'
// Mixpanel re-runs the funnel for only matching users
// Programmatically via Segmentation API:
const segment = {
'event': 'Sign Up Started',
'unit': 'user_id',
'on_properties': [
{'name': 'device', 'operator': '==', 'value': 'mobile'},
{'name': 'country', 'operator': '==', 'value': 'US'}
]
};Common Pitfalls
- Not tracking user_id consistently across events—Mixpanel can't match funnel steps if users are anonymous or their IDs change between events
- Including too many funnel steps (8+)—deep funnels are harder to interpret; break them into smaller funnels instead
- Forgetting to add user properties—without properties like plan_type or signup_source, you can't segment funnels and identify underperforming cohorts
- Assuming linear funnels—if users can skip steps or go backward, your funnel won't reflect real behavior; use the Data Access API for non-linear journeys
Wrapping Up
You now have a working funnel that shows exactly where users drop off and which cohorts need optimization. Build your funnels, apply segments by user behavior, and iterate based on cohort-level insights. If you want to track this automatically across tools, Product Analyst can help.