PostHog Product Analytics
An All-in-One Product Platform, Not Just Analytics
PostHog bundles product analytics (event tracking, funnels, trends, retention), session replay, feature flags, A/B testing/experimentation, and a surveys tool into a single platform with a single SDK and event schema underlying all of it. The architectural idea is that a feature flag rollout, the experiment measuring its impact, and the analytics dashboard reporting on it should all share the same event pipe rather than being stitched together across three separate vendors with three separate tracking snippets and three separate definitions of what a 'user' is.
Event Model: Autocapture vs Explicit Events
PostHog's JS SDK supports autocapture, which automatically tracks clicks, form submissions, and pageviews without any manual instrumentation — useful for getting a baseline of UI interaction data running in minutes. But autocapture events ($autocapture) are keyed off DOM selectors and element text, which is brittle against UI refactors and insufficient for anything requiring business-meaning context (plan tier, feature flag variant, order value). Production use almost always layers explicit posthog.capture() calls for meaningful business events on top of autocapture for incidental UI coverage.
import posthog from 'posthog-js';
posthog.init('phc_YOUR_PROJECT_KEY', {
api_host: 'https://us.i.posthog.com',
person_profiles: 'identified_only', // cost control: avoid creating
// a person profile for every
// anonymous visitor
});
// Identify once the user is known (login, signup)
posthog.identify(userId, { email, plan: 'pro' });
// Explicit business event, independent of autocapture
posthog.capture('trial_started', {
plan: 'pro',
trial_length_days: 14,
source: 'pricing_page_cta',
});
// Feature flag check feeding both targeting and experiment analysis
if (posthog.isFeatureEnabled('new-onboarding-flow')) {
// render variant
}person_profiles Setting Directly Controls Your Bill
person_profiles at its default of creating a profile for every anonymous visitor (rather than identified_only) can multiply your billed person count dramatically for high-traffic, low-conversion marketing sites. This single config flag is one of the most common and most expensive misconfigurations teams discover only after their first invoice.Funnels and Retention: The Core Product-Analytics Workflows
PostHog's funnel tool lets you define an ordered sequence of events (e.g., page_view → signup_started → signup_completed → trial_started) and see conversion rate and drop-off at each step, with breakdowns by any event property or person property (plan, acquisition channel, device). Retention analysis cohorts users by their first qualifying event and tracks what percentage return and perform a second qualifying event in subsequent periods — the standard way product teams measure whether a feature or onboarding change actually sticks, as opposed to just generating a one-time spike in usage.
Session Replay Tied to the Same Event Stream
Because session replay shares PostHog's event pipeline, you can jump directly from 'users who dropped off at step 3 of this funnel' to watching actual session recordings of those specific users hitting that exact point — closing the gap between quantitative funnel data (where users drop off) and qualitative understanding (why they dropped off, e.g., a confusing UI element or a broken button) without switching tools or re-identifying which sessions correspond to which funnel segment.
Feature Flags Double as Experiment Infrastructure
Self-Hosting Option
PostHog is open-source and offers a self-hosted deployment (PostHog Open Source) in addition to its managed cloud product, giving teams with strict data residency needs an escape hatch the fully-managed-only competitors (Amplitude, Mixpanel) don't offer. Self-hosting PostHog at scale is nontrivial — it runs on ClickHouse underneath and self-hosted deployments are explicitly recommended only for teams with the infrastructure expertise to operate it; PostHog itself steers most customers toward the cloud product unless data residency is a hard requirement.
What's Next?
PostHog competes most directly with Mixpanel and Amplitude for the core product-analytics workflow, and the differences between those platforms come down to pricing model, statistical rigor in experimentation, and how deeply each integrates with the rest of a product team's existing stack.
I build these systems professionally.
Whether it's a RAG pipeline, analytics migration, or AI workflow — let's talk.