PostHog is an open source, all-in-one product OS designed for product engineers and data teams who need deep insights into user behavior without relying on multiple SaaS tools. It solves the fragmentation problem in product analytics by combining event tracking, session replays, feature flags, error tracking, surveys, and a built-in data warehouse into a single, self-hostable platform. Built for developers, it supports JavaScript, Python, React, Node, and more via SDKs, and offers both cloud and self-hosted deployment options.
The platform is built on a modern tech stack including Python (Django), PostgreSQL, ClickHouse, Redis, and TypeScript/React for the frontend. It integrates with 120+ data sources like Stripe, HubSpot, and Snowflake via its CDP pipelines, and supports SQL-based analysis, real-time event capture, and AI-powered insights. PostHog’s MIT-licensed core allows full transparency and control over customer data, with optional enterprise features in the ee/ directory.
What You Get
- Product Analytics - Autocapture or manually instrument user events with JavaScript, Python, or React SDKs; analyze behavior using visual funnels, retention curves, and SQL-based queries.
- Session Replays - Record and watch real user sessions with mouse movements, clicks, and scroll behavior to diagnose UX issues and understand user journeys.
- Feature Flags - Safely roll out features to targeted user segments using no-code or API-based flag management with percentage-based targeting and user properties.
- Experiments (A/B Testing) - Run statistical A/B tests on features or UI changes with built-in significance testing and goal metric tracking without code changes.
- Error Tracking - Automatically capture frontend and backend exceptions, group errors, and receive alerts with stack traces and user context.
- Surveys - Deploy no-code or custom surveys with conditional logic to collect user feedback directly in-app with NPS, CSAT, and open-text templates.
- Data Warehouse & CDP - Ingest data from Stripe, HubSpot, and other tools into a built-in data warehouse; transform and route data to 25+ destinations via pipelines with SQL transformations.
- PostHog AI - Ask natural language questions about user behavior, auto-generate insights, summarize session replays, and eventually auto-fix bugs via AI-powered code suggestions.
- Workflows - Automate actions like sending Slack alerts, triggering emails, or updating CRM records based on user events or feature flag usage.
- Web Analytics Dashboard - Monitor page views, bounce rates, conversion funnels, and Core Web Vitals with a GA-like interface that includes revenue tracking.
Common Use Cases
- Running a SaaS product with user behavior insights - A product manager uses PostHog to track feature adoption, identify drop-off points in onboarding, and run A/B tests on pricing pages to increase conversions.
- Debugging mobile app crashes in production - A mobile engineer integrates PostHog’s React Native and iOS SDKs to capture crashes, view session replays of failed flows, and fix bugs before users churn.
- Building a data-driven startup with limited engineering resources - A founder uses PostHog’s free tier to track user activation, retention, and revenue without hiring a data team or paying for multiple tools like Mixpanel, Hotjar, and Sentry.
- Syncing CRM and payment data with product usage - A growth team connects Stripe payments and HubSpot leads to PostHog’s data warehouse to analyze which customer segments convert best based on in-app behavior.
Under The Hood
Architecture
- Monolithic Python/Django backend with tightly coupled components and no explicit service layer, despite leveraging Celery for async processing
- Rust and Go microservices with clear boundaries, deployed via Docker and connected through Kafka for event-driven data pipelines
- Frontend uses Kea for predictable state management with component-level isolation, though dependency injection is absent
- Multi-repo structure coordinated by Turbo monorepo tooling to enable parallelized builds and shared artifacts across languages
- Event-driven data ingestion via Kafka and ClickHouse, with dedicated pipelines for session replay, AI capture, and livestreaming
Tech Stack
- Rust and Go for high-performance data capture and processing, containerized with Docker for isolation
- Postgres 15 and ClickHouse as primary and analytical data stores, supported by Kafka and Zookeeper for scalable event streaming
- TypeScript frontend with React, Kea state management, and Parcel bundling, enhanced by strict typing and modern linting
- Comprehensive testing suite with Jest, Playwright, and Pytest, orchestrated via Turborepo for cross-language test execution
- OpenTelemetry for distributed tracing and log aggregation, with OTLP exporters to Jaeger and custom logging services
- CI/CD powered by GitHub Actions, cargo-dist for Rust binaries, and Docker Compose variants for diverse deployment environments
Code Quality
- Extensive test coverage across all layers with unit, integration, and state-based tests using mocking and snapshot utilities
- Strong type safety and consistent naming conventions in both frontend and backend codebases
- Robust error handling, caching strategies, and rate-limiting mechanisms in backend services
- Well-organized test directories and reusable test helpers that promote maintainability and reduce duplication
- Consistent use of mocking and patching to isolate dependencies and validate behavior over implementation
What Makes It Unique
- Hedgehog Mode enables dynamic, plugin-like UI extensions that decouple feature logic from the core application
- Hog Functions allow users to define custom event processing logic directly in the UI via a domain-specific language
- Integrated webhook testing with real-time mock simulation and auto-generated code snippets enhances developer workflow
- Lemon UI library is deeply integrated with product logic, reducing frontend boilerplate and ensuring design consistency
- Native customer feedback loops embedded in analytics interfaces create a closed-loop system for product iteration