Retention tells you if users come back. Are customers actually using your product after they sign up, or is churn killing your metrics? PostHog's Retention chart lets you define exactly which users to track and which actions signal they've returned—then shows you the pattern.
Track the events that matter
Retention analysis starts with two events: one for signup (your cohort start) and one for return (your success metric).
Capture signup and identify users
When a user signs up, call identify() with their user ID and relevant properties, then capture() the signup event. This creates the cohort you'll track in retention.
posthog.identify('user_12345', {
email: '[email protected]',
plan: 'pro',
signup_date: new Date().toISOString()
});
posthog.capture('user_signed_up', {
plan: 'pro',
source: 'google_ads',
country: 'US'
});Track engagement events that signal return
Define what "returning" means for your product. Log in? View a dashboard? Make a purchase? Capture it consistently so PostHog can measure if users do it again.
// Track return on login
posthog.capture('user_logged_in', {
auth_method: 'google_oauth',
device: 'web'
});
// Or track product engagement
posthog.capture('dashboard_opened', {
dashboard_id: 'main',
session_id: generateSessionId()
});Build the retention chart
Once events are flowing, configure the chart to track cohort behavior over time.
Go to Insights > Retention
Open Insights in the left sidebar, then click the Retention tab at the top. PostHog loads a blank retention chart.
Select your starting and returning actions
Set Starting action to user_signed_up (this defines Day 0). Set Returning action to user_logged_in or dashboard_opened (whatever signals engagement). Choose Day, Week, or Month for the time period.
// The PostHog UI will now show:
// Starting action: user_signed_up (Day 0)
// Returning action: user_logged_in
// Time period: Day
// This generates a heatmap of Day 0 → Day 1, 7, 14, etc.Interpret the retention heatmap
Green cells = high retention, red = low. Read left-to-right: Day 0 is 100% (all signups), Day 1 might be 40% (40% returned), Day 30 might be 15% (churn accelerates). This guides where to focus: low Day 1 means onboarding is broken; low Day 30 means engagement dies after first month.
Filter and compare cohorts
Drill into segments to find which users stick around and which churn fast.
Filter by user properties
Click Add filter in the retention chart. Filter by plan = pro to see if paid customers retain better, or by source = organic to compare acquisition channels. The chart re-runs showing only users matching that filter.
// Your signup event already has these properties
posthog.capture('user_signed_up', {
plan: 'pro', // Filter by this
source: 'google_ads', // Filter by this
country: 'US', // Filter by this
monthly_users: 50000 // Filter by this
});
// In PostHog UI, set filter: plan = 'pro'
// Now the retention chart shows only pro usersExport retention data
Once you're confident in the trend, export the retention data as CSV or embed the chart on a dashboard. Most teams review retention weekly alongside churn and engagement metrics.
Common Pitfalls
- Misidentifying users across sessions breaks everything. If user_12345 on Day 0 is a different ID on Day 1, PostHog treats them as new and retention plummets.
- Picking the wrong returning event. If you choose 'page_view' and your SPA only fires page_view on initial load, returning users won't show up. Pick an event users actually trigger repeatedly.
- Trusting incomplete data. If today is Day 1 and some users' return events haven't arrived yet, Day 1 retention looks worse than it is. Always wait a full day before pulling retention into reports.
- Filtering by properties *after* creating the chart hides the baseline. Always think: 'Do I want to see retention of [this segment], or retention overall?'
Wrapping Up
You now have a retention chart showing when users churn. Use it to decide what to build: if Day 1 retention is terrible, fix onboarding; if Day 7 crashes, fix engagement. Watch the trend monthly to see if changes work. If you want to track this automatically across tools, Product Analyst can help.