PostHog for AI products: product analytics, LLM analytics and open-source alternatives Plausible, Umami and Langfuse in 2026
What PostHog includes
PostHog started in 2020 as an open-source alternative to Mixpanel and Amplitude and has grown into a suite of tools that share one event store:
| Product | What it does |
|---|---|
| Product analytics | Trends, funnels, retention, paths and user cohorts |
| Web analytics | Traffic, sources and pages, similar to Google Analytics |
| Session replay | Recordings of user sessions with console and network logs |
| Feature flags | Roll out features to some users; kill switches |
| Experiments | A/B tests with statistical results |
| Surveys | In-app questions and feedback |
| Error tracking | Exceptions linked to users and replays |
| Data warehouse | Import data from Stripe, databases and other sources; query with SQL |
| LLM analytics | Model call tracking with cost, latency and content |
Having everything in one place means you can, for example, filter session replays to users who saw an AI feature flag and then gave a low survey score.
Which directory projects fit here
| Project | Focus | License |
|---|---|---|
| PostHog | All-in-one product analytics platform | MIT (ee directory separate) |
| Plausible | Simple, cookie-free website analytics | AGPLv3 |
| Umami | Lightweight, privacy-focused website analytics | MIT |
| Langfuse | LLM tracing, evaluation and prompt management | MIT core |
Pricing
PostHog Cloud bills each product separately by usage, with a free allowance every month:
| Product | Free each month |
|---|---|
| Product analytics | 1,000,000 events |
| Session replay | 5,000 recordings |
| Surveys | 1,500 responses |
| Other products | Their own free allowances |
Above the free tier, per-unit prices fall as volume grows. Use PostHog's pricing calculator for estimates, and set a billing limit per product. Paid add-ons, such as group analytics for B2B products and extra data retention, are priced separately.
Self-hosting PostHog
PostHog offers a hobby Docker Compose deployment:
- License. MIT, except the
eedirectory, which has its own license. - Releases. None tagged. Changes and security fixes ship continuously, and PostHog recommends always running the latest image.
- Features. Paid-plan features are available only on Cloud.
- Support. None for self-hosted installs.
- Components. ClickHouse, Kafka, PostgreSQL, Redis, object storage and several PostHog services.
- Scale. Recommended for low volumes; PostHog suggests Cloud for production scale.
For teams that need data in Europe, PostHog's EU Cloud region is the usual answer.
Tracking AI features with PostHog
Product events
Capture an event when a user starts an AI action, accepts or edits a suggestion, regenerates, or gives feedback. Add properties for the feature name, model, prompt version and latency. Then build:
- A funnel from "opened AI panel" to "accepted suggestion".
- Retention of users who used AI features compared with those who did not.
- Cohorts of heavy AI users for interviews or pricing tests.
LLM analytics
PostHog's SDK wrappers for OpenAI, Anthropic and frameworks such as LangChain and the Vercel AI SDK capture each generation automatically with model, token counts, cost, latency, and optionally inputs and outputs. Because generations are tied to the same person and session as other events, you can calculate model cost per customer and compare it with revenue, a key number for pricing AI features.
Feature flags and experiments for prompts
Use a feature flag to send a share of users to a new prompt or model, then compare acceptance rate, retention and cost in an experiment. Flags with payloads can carry the prompt version or model name directly, so you can change them without a deploy.
Session replay for AI interfaces
Watching replays of sessions where users regenerated an answer several times or abandoned the chat shows problems that metrics miss, such as confusing loading states or answers rendered off-screen. Mask inputs in replays, since chat boxes often contain personal data.
Plausible and Umami
For a marketing site or documentation, a full product analytics suite is more than needed. Plausible and Umami collect page views, referrers, countries, devices and custom goals with a small script and no cookies, which often removes the need for a cookie banner under EU rules. Umami is MIT-licensed and easy to self-host with Node.js and PostgreSQL or MySQL; Plausible offers a hosted service and an AGPL Community Edition.
Langfuse alongside PostHog
PostHog's LLM analytics covers cost and usage in product context. Langfuse goes deeper on engineering: nested traces of agent steps, prompt management, datasets and evaluations. A common split is Langfuse for the AI engineering team and PostHog for product and growth, linked by a shared user ID.
Choosing an analytics setup for an AI product
| Stage | Setup |
|---|---|
| Landing page only | Plausible or Umami |
| Early product | PostHog Cloud free tier with product analytics and replay |
| AI features in production | Add PostHog LLM analytics or Langfuse for traces |
| Growing team testing prompts | PostHog experiments plus Langfuse evaluations |
| Strict data residency | PostHog EU Cloud, or self-hosted Plausible or Umami for web analytics |
Privacy and consent
AI apps handle sensitive text. Do not send full prompts to analytics unless you need them, mask chat inputs in session replay, honor opt-outs, and document analytics in your privacy policy. PostHog can run cookieless by keeping identifiers in memory, which reduces consent requirements for anonymous traffic, though identified users and replays still need care under GDPR.
Metrics worth tracking for AI features
| Metric | How to compute in PostHog |
|---|---|
| AI feature adoption | Share of weekly active users who triggered an AI event |
| Acceptance rate | Accepted suggestions divided by shown suggestions |
| Regeneration rate | Regenerate clicks per answer; high values signal poor first answers |
| Time to value | Time from signup to first accepted AI output |
| Cost per active user | Sum of generation cost from LLM analytics divided by active users |
| Retention lift | Retention curve of AI users compared with non-AI users |
Implementation checklist
- Install the PostHog snippet or SDK, and route it through a reverse proxy on your own domain so ad blockers do not drop events.
- Call
identifyafter login with a stable user ID, and set company with group analytics if you sell to businesses. - Define a short event naming scheme, such as
ai_suggestion_shownandai_suggestion_accepted, and document it. - Wrap your model client with PostHog's LLM analytics integration and pass the same user ID.
- Build one dashboard for AI feature adoption and one for AI cost per customer.
- Set billing limits on every product before traffic grows.
Related: Plausible stack, Langfuse stack, Django stack, Stripe stack, OpenTelemetry stack, Stack index.
Frequently asked questions
Is PostHog free?
PostHog Cloud is free up to monthly allowances, including 1 million analytics events, 5,000 session recordings and 1,500 survey responses, with similar allowances for other products. Beyond that, each product is billed by volume with decreasing per-unit prices. You can set billing limits so you are never charged more than you choose.
Should I self-host PostHog?
Only for small volumes or strict data rules, and with the trade-offs in mind. The self-hosted Docker Compose deployment is free and MIT-licensed, but it has no support, no paid features, no versioned releases and needs ClickHouse, Kafka, PostgreSQL and Redis to run. Most teams with data residency needs choose PostHog's EU Cloud instead.
What are PostHog LLM analytics?
A PostHog product that records model calls, called generations, with model, tokens, cost, latency and inputs and outputs, and links them to the user and session. It integrates with OpenAI, Anthropic, LangChain, the Vercel AI SDK and other libraries, and lets you analyze AI usage with the same tools as other product data.
Should I use PostHog or Langfuse for an AI app?
PostHog answers product questions: which users use AI features, whether they convert, and cost per customer alongside revenue and retention. Langfuse answers engineering questions: why a specific trace failed, how prompt versions compare on evaluations. Many AI teams use both.
PostHog or Plausible for a website?
Plausible for a simple, cookie-free view of traffic, sources and goals on a marketing site. PostHog when you also need product analytics inside your app, session replay, feature flags or experiments.