ToolScout
Templates
Home/Monitoring/PostHog
Monitoring
posthog

PostHog

TypeScriptPythonOpen-sourceAnalyticsFeature Flags

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.

License

MIT

Language

TypeScript / Python

81
Trust
Strong

Why PostHog?

Product analytics + feature flags in one tool

You want Mixpanel-quality analytics self-hostable

Building user funnels, retention analysis, and A/B tests

Signal Breakdown

What drives the Trust Score

npm downloads
400k / wk
Commits (90d)
500 commits
GitHub stars
24k ★
Stack Overflow
3k q's
Community
Very active
Weighted Trust Score81 / 100

Download Trend

Last 12 months

Tradeoffs & Caveats

Know before you commit

Pure error monitoring (use Sentry)

Infrastructure monitoring (use Prometheus/Grafana)

You only need basic Google Analytics-style pageviews

Pricing

Free tier & paid plans

Free tier

Free up to 1M events/mo

Paid

From $0 (generous free tier)

Open-source — self-host for free forever

Alternative Tools

Other options worth considering

mixpanel
Mixpanel76Good

Product analytics platform focused on user behavior and conversion funnels. Excellent for understanding how users interact with your product and optimizing conversion rates.

View Compare
google-analytics
Google Analytics45Limited

The most widely used web analytics platform. Track user behavior, conversions, and marketing campaign performance across websites and apps. Free tier covers most small to medium businesses.

View Compare
See all alternatives to PostHog

Often Used Together

Complementary tools that pair well with PostHog

nextjs

Next.js

Frontend & UI

98Excellent
View
vercel

Vercel

Hosting & Deploy

89Strong
View
supabase

Supabase

Database & Cache

95Excellent
View
mixpanel

Mixpanel

Marketing & Analytics

76Good
View
sentry

Sentry

Monitoring

94Excellent
View

Learning Resources

Docs, videos, tutorials, and courses

PostHog Docs

docs

GitHub repo

github

PostHog getting started

tutorial

Get Started

Repository and installation options

View on GitHub

github.com/PostHog/posthog-js

npmnpm install posthog-js
pippip install posthog

Quick Start

Copy 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' });

Code Examples

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,
});

Community Notes

Real experiences from developers who've used this tool