PostHog is an all-in-one, open source platform for building successful products. It provides every tool you need including product analytics, web analytics, session replay, feature flags, experiments, error tracking, surveys, data warehouse, and data pipelines.

What is PostHog?

PostHog is a comprehensive product analytics and experimentation platform that combines multiple tools into a single integrated solution. With 33,211 stars and a rapidly growing community, it’s becoming the go-to choice for product teams who want to understand user behavior and iterate faster.

Platform Architecture

PostHog Architecture

PostHog’s architecture is built around a central data collection layer that feeds into multiple product modules:

Core Products

Product Description Use Case
Product Analytics Event-based analytics with autocapture Understand user behavior, funnels, retention
Web Analytics GA-like dashboard for web traffic Monitor traffic, conversions, web vitals
Session Replay Real user session recordings Diagnose issues, understand user behavior
Feature Flags Safe rollouts to select users Gradual feature releases, targeting
Experiments A/B tests with statistical analysis Measure impact of changes
Error Tracking Error monitoring and alerts Track and resolve issues
Surveys No-code survey builder Collect user feedback
Data Warehouse Sync external data sources Query product data alongside business data
Data Pipelines Transform and route data Real-time or batch processing
LLM Analytics Track LLM app performance Capture traces, latency, cost

Data Flow

Data Flow

PostHog processes data through a well-defined pipeline:

  1. Event Capture: SDKs or API collect user interactions
  2. Ingestion: Validation and enrichment of incoming data
  3. Processing: Transformation and filtering
  4. Storage: ClickHouse for analytics, PostgreSQL for metadata
  5. Query Engine: SQL and API access to data
  6. Visualization: Dashboards and insights

Deployment Options

Deployment Options

  • Free Tier: 1M events, 5k recordings, 1M flag requests, 100k exceptions, 1500 survey responses/month
  • US and EU regions available
  • Zero maintenance required

Self-Hosted (Open Source)

# One-line hobby deploy on Linux with Docker
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby)"
  • Scales to ~100k events/month
  • MIT licensed (with posthog-foss for 100% FOSS)
  • No customer support provided

SDK Integrations

SDK Integrations

PostHog provides SDKs for all major platforms:

Frontend Mobile Backend
JavaScript React Native Python
Next.js Android Node.js
React iOS PHP
Vue Flutter Ruby
Angular   Go
WordPress   .NET/C#

Key Features

Product Analytics

  • Autocapture: Automatically track user interactions
  • Custom Events: Manual instrumentation for specific actions
  • Funnels: Track conversion paths
  • Retention: Analyze user retention curves
  • SQL Access: Query data directly with SQL

Session Replay

  • Real Recordings: Watch actual user sessions
  • Heatmaps: Visualize click patterns
  • Privacy Controls: Mask sensitive data
  • Mobile Support: iOS and Android recordings

Feature Flags

  • Gradual Rollouts: Release to percentage of users
  • Targeting: Roll out to specific cohorts
  • Multivariate: Test multiple variants
  • Payloads: Send configuration with flags

Experiments

  • No-Code Setup: Create experiments without engineering
  • Statistical Significance: Built-in statistical analysis
  • Goal Metrics: Track primary and secondary metrics
  • Automatic Allocation: Traffic distribution

LLM Analytics

PostHog now supports LLM-powered application analytics:

  • Capture traces and generations
  • Monitor latency and costs
  • Track token usage
  • Analyze model performance

Data Warehouse

Sync data from external tools:

  • Stripe: Revenue and subscription data
  • HubSpot: CRM data
  • Snowflake/BigQuery: Warehouse data
  • Custom Sources: Any data via API

Query external data alongside product events for comprehensive analysis.

Pricing

PostHog offers a generous free tier for each product:

  • 1M events/month
  • 5k session recordings/month
  • 1M feature flag requests/month
  • 100k exceptions/month
  • 1500 survey responses/month

Paid plans are usage-based and completely transparent.

Getting Started

# Install JavaScript snippet
<script>
    !function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
    posthog.init('YOUR_API_KEY',{api_host:'https://app.posthog.com'})
</script>

Conclusion

PostHog represents a new paradigm in product analytics — combining traditionally separate tools (analytics, replay, flags, experiments) into a single, integrated platform. This consolidation eliminates data silos, reduces integration complexity, and provides a unified view of the user journey.

Whether you’re a startup looking for a free, comprehensive analytics solution or an enterprise needing advanced experimentation capabilities, PostHog offers a compelling open-source alternative to proprietary tools like Mixpanel, Amplitude, or LaunchDarkly.

Get Started: GitHub Repository Documentation PostHog Cloud
Watch PyShine on YouTube

Contents