Churn rate is the percentage of users who stop using your product in a given period. PostHog doesn't calculate it automatically—you define what 'active' means, track it, then measure who didn't come back. This is how most teams actually track churn.
Set Up Event Tracking for Active Users
Churn only makes sense if you're consistent about what counts as 'active.' Decide on an event—login, dashboard view, API call—then capture it reliably.
Step 1: Define and capture an activity event
Choose a single event that signals an active user. Common choices: user_login, page_view, app_opened. Use posthog.capture() to send it from your application every time it happens.
// Track when a user logs in or opens your app
posthog.capture('user_login', {
source: 'web',
plan: user.subscriptionTier,
days_active: calculateDaysSinceSignup(user.createdAt)
});
// Or track a core action specific to your product
posthog.capture('dashboard_opened', {
has_created_report: user.reportCount > 0,
last_active: user.lastLoginDate
});Step 2: Ensure your event fires consistently
Test that the event is captured every time the user performs the action. Use Data Management > Events to see event volume and confirm there are no gaps.
page_view instead of a more meaningful action, your churn will be noise (bounces, accidental closes, etc.). Pick an intentional action.View Churn with Retention Analysis
PostHog's Retention insight shows retention cohorts. Churn is the inverse: if 40% of users return, 60% churned.
Step 1: Create a retention insight
Go to Insights > + New insight and select Retention. Set the initial event (e.g., user_login) and the returning event (the same event again). This shows which cohorts came back.
Step 2: Configure the retention period
Choose a period that matches your business: Day for daily apps, Week for weekly engagement, Month for monthly subscriptions. The matrix will show cohorts on the left and retention % for each period.
// Retention insight logic (configured in PostHog UI)
const retentionSetup = {
initial_event: 'user_login',
returning_event: 'user_login',
period: 'Week', // Or 'Month', 'Day'
range: 'Last 8 weeks' // See up to 8 weeks of cohort data
};
// Interpretation:
// Week 0 (signup cohort): 100% (by definition)
// Week 1: 45% (45% of week-0 cohort came back in week 1)
// Week 4: 18% (18% came back in week 4)
// Churn in week 1 = 100% - 45% = 55%Step 3: Segment by user properties
Click Breakdown by and select a property (plan tier, region, signup date) to see how churn differs across segments. Paid users churn slower; free users churn faster. This is where you find the patterns.
Calculate Explicit Churn Rate with SQL
For a single churn percentage (not a matrix), query PostHog's event table directly using SQL to calculate month-to-month or week-to-week churn.
Step 1: Open SQL insights
Go to Insights > + New insight and select SQL. Write a query that counts active users in two consecutive periods and calculates the percentage who dropped.
Step 2: Query active users and calculate churn
The query identifies users active in one period but not the next. Divide the churned count by the original cohort size, multiply by 100 for percentage.
-- Calculate monthly churn rate
WITH previous_month AS (
SELECT DISTINCT user_id
FROM events
WHERE event = 'user_login'
AND timestamp >= date_trunc('month', now() - interval '1 month')
AND timestamp < date_trunc('month', now())
),
current_month AS (
SELECT DISTINCT user_id
FROM events
WHERE event = 'user_login'
AND timestamp >= date_trunc('month', now())
AND timestamp < date_trunc('month', now() + interval '1 month')
)
SELECT
(SELECT COUNT(*) FROM previous_month) AS users_last_month,
(SELECT COUNT(*) FROM previous_month WHERE user_id IN (SELECT user_id FROM current_month)) AS users_retained,
ROUND(
100.0 * (
1 - (SELECT COUNT(*) FROM previous_month WHERE user_id IN (SELECT user_id FROM current_month))::numeric
/ (SELECT COUNT(*) FROM previous_month)::numeric
),
2
) AS churn_rate_percent;Step 3: Filter by user properties to segment churn
Add WHERE properties->>'plan' = 'paid' to see paid-only churn, or filter by signup cohort, region, or any tracked property. This reveals which segments are most at risk.
Common Pitfalls
- Churn is meaningless without a consistent definition of 'active.' If you switch from daily login to monthly pageview, historical churn numbers become incomparable.
- Don't wait for a single missed activity to mark someone churned. Use a grace period (30 days, 7 days) to separate temporary absence from actual churn.
- Retention retention matrices hide bad news. If day-7 retention is 35%, you're losing 65% of users per week. Calculate churn percentage explicitly to see the scale of the problem.
- Aggregate churn (all users) is less useful than segmented churn (by plan, signup cohort, feature adoption). Free users churn 5x faster than paid, but averaging them obscures both.
Wrapping Up
Churn rate is the inverse of retention: if 40% come back, 60% churned. PostHog lets you measure it by capturing activity events, running retention insights, and calculating churn with SQL. Segment by cohort to find which users churn fastest and why. If you want to track this automatically across tools and get anomaly alerts, Product Analyst can help.