Funnels show you where users drop off in your product flow. PostHog makes it easy to track a multi-step journey—from signup through payment—and see exactly which step loses the most people. This guide walks you through instrumenting events and building your first funnel.
Track Events That Matter
Before you build a funnel, you need to emit the events that represent each step.
Initialize PostHog and Capture Events
Add the PostHog SDK to your app and start sending events. Each funnel step needs its own event. Use posthog.capture() to send an event with the event name and any properties you want to record.
import posthog from 'posthog-js';
// Initialize PostHog (usually in your app entry point)
posthog.init('your-api-key', {
api_host: 'https://app.posthog.com',
});
// Track a user viewing the pricing page
posthog.capture('pricing_viewed', {
plan: 'pro',
source: 'navbar',
});
// Track a signup event
posthog.capture('user_signup', {
email: user.email,
signup_method: 'google',
});
// Track a payment attempt
posthog.capture('payment_attempted', {
amount: 99,
currency: 'USD',
});Use Consistent Event Names
Event names should be descriptive and consistent. Avoid adding timestamps or user IDs to the event name—use properties instead. PostHog automatically tracks $user_id, but you can also set custom user properties with posthog.people.set().
// Good: clear, reusable event names
posthog.capture('checkout_started');
posthog.capture('checkout_completed');
// Bad: event names with timestamps or user IDs
posthog.capture('checkout_12345');
posthog.capture('user_123_checkout');
// Set custom user properties for segmentation
posthog.people.set({
plan: 'enterprise',
industry: 'saas',
mrr: 5000,
});Build Your Funnel in PostHog
Once events are flowing, create a funnel to visualize the conversion path.
Navigate to Funnels
In your PostHog dashboard, go to Insights in the left sidebar, then click Funnels. This opens the funnel builder where you'll define your steps.
Add Steps to Your Funnel
Click + Add step and select the events that represent each stage. The order matters—PostHog calculates the conversion rate from step to step. For a typical signup flow, you might use pricing_viewed → signup_started → user_signup → payment_attempted → payment_completed.
// Your event sequence (defined in PostHog UI, not code)
// Step 1: posthog.capture('pricing_viewed')
// Step 2: posthog.capture('signup_started')
// Step 3: posthog.capture('user_signup')
// Step 4: posthog.capture('payment_attempted')
// Step 5: posthog.capture('payment_completed')
// PostHog calculates:
// Step 1 → 2: % of users who view pricing and start signup
// Step 2 → 3: % of users who complete signup
// Step 3 → 4: % of users who attempt payment
// Step 4 → 5: % of users who complete paymentApply Filters and Breakdowns (Optional)
Filter your funnel by user properties or event properties. For example, filter to only users from the US, or break down your funnel by plan type to see if enterprise users convert differently. Click Filter in the funnel builder and choose your criteria.
// Example: capture events with properties for filtering
posthog.capture('user_signup', {
country: 'US',
plan: 'pro',
source: 'ad',
});
// In PostHog UI, filter by:
// - country = 'US'
// - plan = 'pro'
// - source = 'ad'
// This shows conversion for a specific segment.Analyze and Act on Results
Once your funnel is live, you can dig into the data to find optimization opportunities.
Identify Drop-Off Points
PostHog shows you the percentage of users completing each step and the absolute count. Look for the steepest drop-offs—these are your biggest optimization targets. Hover over a step to see detailed stats, including the time users spent before converting.
Compare Funnels Across Segments
Use the Breakdown by feature to split your funnel by user properties. For example, break down by device type to see if mobile users drop off more during checkout, or by signup source to see which campaigns have the highest-quality users.
// Ensure you're tracking the properties you want to segment by
posthog.capture('checkout_started', {
device_type: 'mobile', // or 'desktop'
signup_source: 'google_ads', // or 'organic', 'direct'
plan: 'starter', // or 'pro', 'enterprise'
});
// In PostHog UI, use Breakdown by:
// - device_type: see if mobile checkout is broken
// - signup_source: see which channels bring quality users
// - plan: see if enterprise users have different conversion ratesExport Funnel Data
Click the Export button to download funnel results as CSV. You can use this data in spreadsheets or feed it into your internal dashboards. The export includes step counts, conversion rates, and timing data.
Common Pitfalls
- Forgetting to track a step mid-funnel. If Step 2 → 3 looks empty, users either didn't hit Step 2 or didn't trigger Step 3 afterward. Check your event names and properties.
- Using too many steps in one funnel. If a user takes 3 days to move through 6 steps, PostHog won't connect them. Use shorter, single-session funnels.
- Not setting user properties early. If you want to segment by plan or region, capture those properties in your signup event, not days later.
- Treating low conversion rates as a bug. Funnels often show harsh numbers—50% drop-off is common. Use breakdowns to find which segment is underperforming, not the funnel itself.
Wrapping Up
You now have a working funnel in PostHog showing where users drop off in your product. Start with a simple flow, like signup → payment, then add more funnels for different user journeys. As you discover patterns, use the breakdown feature to dig into which segments convert best. If you want to track this automatically across tools, Product Analyst can help.