Open-source product analytics with session recording, feature flags, A/B testing, and funnel analysis — all in one platform. PostHog can be self-hosted or cloud-hosted.
MIT
TypeScript / Python
Product analytics + feature flags in one tool
You want Mixpanel-quality analytics self-hostable
Building user funnels, retention analysis, and A/B tests
What drives the Trust Score
Last 12 months
Pure error monitoring (use Sentry)
Infrastructure monitoring (use Prometheus/Grafana)
You only need basic Google Analytics-style pageviews
Free tier & paid plans
Free up to 1M events/mo
From $0 (generous free tier)
Open-source — self-host for free forever
Other options worth considering
Product analytics platform focused on user behavior and conversion funnels. Excellent for understanding how users interact with your product and optimizing conversion rates.
Complementary tools that pair well with PostHog
Docs, videos, tutorials, and courses
Repository and installation options
View on GitHub
github.com/PostHog/posthog-js
npm install posthog-jspip install posthogCopy and adapt to get going fast
import posthog from 'posthog-js';
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
api_host: 'https://us.i.posthog.com',
person_profiles: 'identified_only',
});
posthog.capture('user_signed_up', { plan: 'pro' });Common usage patterns
Feature flags
Gate features with PostHog flags
const isEnabled = posthog.isFeatureEnabled('new-dashboard');
if (isEnabled) {
return <NewDashboard />;
}
return <OldDashboard />;A/B test
Run an experiment with PostHog
const variant = posthog.getFeatureFlag('checkout-experiment');
posthog.capture('$experiment_started', {
'$experiment_key': 'checkout-experiment',
'$experiment_variant': variant,
});Real experiences from developers who've used this tool