RoyceTL;DR PostHog for most SaaS in 2026: replaces Mixpanel + FullStory + LaunchDarkly + Hotjar...
PostHog for most SaaS in 2026: replaces Mixpanel + FullStory + LaunchDarkly + Hotjar with one platform, and the free tier (1M events/month) is excellent. Mixpanel if you need advanced funnel analysis and cohort tracking with a dedicated product analytics team. Custom events to your database for simple tracking when third-party analytics is overkill.
Without analytics, you're guessing:
Analytics gives you data to answer these questions — but only if you track the right events.
PostHog is the fastest-growing product analytics platform. It combines:
Free tier: 1 million events/month. This covers most indie SaaS.
// lib/analytics.ts — PostHog client
process.env.NEXT_PUBLIC_POSTHOG_KEY!,
{ host: process.env.NEXT_PUBLIC_POSTHOG_HOST! }
);
// Type-safe event tracking
event: string,
userId: string,
properties?: Record<string, string | number | boolean>
) {
posthog.capture({
distinctId: userId,
event,
properties,
});
}
// Client-side — auto-track pageviews + capture events
'use client';
const posthog = usePostHog();
const handleClick = () => {
posthog.capture('upgrade_clicked', {
plan,
location: 'pricing_page',
$current_url: window.location.href,
});
};
return <button onClick={handleClick}>Upgrade to {plan}</button>;
}
Every SaaS should track these events at minimum:
// lib/analytics-events.ts — standardized event names
// Acquisition
USER_SIGNED_UP: 'user_signed_up',
USER_SIGNED_IN: 'user_signed_in',
// Activation
ONBOARDING_STARTED: 'onboarding_started',
ONBOARDING_COMPLETED: 'onboarding_completed',
FIRST_CORE_ACTION: 'first_core_action', // First time user uses main feature
// Retention
DASHBOARD_VIEWED: 'dashboard_viewed',
CORE_FEATURE_USED: 'core_feature_used',
// Revenue
UPGRADE_CLICKED: 'upgrade_clicked',
CHECKOUT_STARTED: 'checkout_started',
CHECKOUT_COMPLETED: 'checkout_completed',
PLAN_UPGRADED: 'plan_upgraded',
PLAN_CANCELLED: 'plan_cancelled',
// Sharing/Viral
INVITE_SENT: 'invite_sent',
} as const;
// Usage
trackEvent(Events.PLAN_UPGRADED, userId, {
from_plan: 'free',
to_plan: 'pro',
method: 'stripe_checkout',
mrr_added: 29.99,
});
Once events are tracked, PostHog shows the drop-off at each step:
Onboarding Funnel:
Sign Up → Verify Email → Connect Account → First Action → Invite Team
Results:
100 users signed up
82 verified email (82% → focus: reduce friction here)
45 connected account (55% → BIG drop: investigate connection flow)
30 took first action (67% → okay)
12 invited team member (40% → growth lever)
This tells you where to invest engineering time.
Mixpanel is purpose-built for product analytics. More powerful funnel/cohort features than PostHog, but only does analytics (no session recording, no feature flags).
const mixpanel = Mixpanel.init(process.env.MIXPANEL_TOKEN!);
// Event tracking
mixpanel.track('Plan Upgraded', {
distinct_id: userId,
from_plan: 'free',
to_plan: 'pro',
revenue: 29.99,
});
// User identification with traits
mixpanel.people.set(userId, {
$email: user.email,
$name: user.name,
plan: 'pro',
upgrade_date: new Date().toISOString(),
$revenue: 29.99,
});
Choose Mixpanel when:
For early-stage SaaS, storing events in your own database is often enough:
model AnalyticsEvent {
id String @id @default(cuid())
event String
userId String?
properties Json @default("{}")
createdAt DateTime @default(now())
@@index([event, createdAt])
@@index([userId, createdAt])
}
// lib/track.ts — store events in PostgreSQL
event: string,
userId: string | null,
properties?: Record<string, unknown>
) {
await prisma.analyticsEvent.create({
data: { event, userId, properties: properties ?? {} },
});
}
// Query: how many upgrades this week?
const upgrades = await prisma.analyticsEvent.count({
where: {
event: 'plan_upgraded',
createdAt: { gte: subDays(new Date(), 7) },
},
});
When custom tracking is enough:
When to upgrade to PostHog:
| Boilerplate | Analytics | Provider |
|---|---|---|
| ShipFast | ✅ | Vercel Analytics (basic) |
| Supastarter | ❌ | — |
| Makerkit | ✅ | PostHog |
| T3 Stack | ❌ | — |
| Open SaaS | ✅ | PostHog + Plausible |
Find boilerplates with analytics setup on StarterPick.