Skip to content
Agents tracked: 504 Releases (7d): 602 Agent status: no reported issuesSince last limit reset: Claude 13d · Codex 11d For AI agents: Markdown Updated Nov 24, 2026

PostHog

See what users do in your product.

Error tracking and analytics

WebsitePricingGitHub

1. Price

“97% of companies use PostHog for free.”

Free tier: 1M events, 5K session replays, 1M feature flag requests, 100K exceptions, 1500 survey responses per month. As reported on the official pricing page, checked Oct 9, 2026.

posthog.com/pricing

Checked against the maker's official pages, pricing on Oct 9, 2026. Tap a verdict to see its source.How we checkedReport an error

What PostHog does

PostHog is an online service that records what people do in your website or app, such as page views, clicks and sign-ups, and turns it into charts. The same account also gives you screen recordings of visits, feature switches for gradual launches, error reports and in-app surveys. Each product has a free monthly allowance; above it you pay per use.

  • PostHog is one of 27 APIs in the Error tracking and analytics category on AgentGid.
  • It is one of 20 that can be started for free.
  • 5 of them ship an official MCP server; PostHog does not.
  • Its official SDK is the 2nd most downloaded in the category (40.2M a week).

What people build with it

Find where sign-ups drop off

See how many visitors reach each step from landing page to paid plan, and which step loses the most people.

Watch recordings of confusing screens

Replay real visits to see where people click, scroll and get stuck, for example on a checkout page.

Launch a feature to some users first

Turn a new feature on for 10% of users or for beta testers only, and switch it off without a new release if it breaks.

Catch errors users actually hit

Collect crashes from the browser and the server, then watch the recording of the visit where the error happened.

Quick in-app surveys

Ask a short question inside your app, such as "How likely are you to recommend us?", and see the answers next to usage data.

Track the cost of AI features

Log each call your app makes to an AI model, with tokens used and cost, to see which feature is expensive.

PostHog popularity

37.7M
SDK downloads a week
+25.4% on the 4-week average
572
public agent repos use its SDK
41K
GitHub stars, PostHog/posthog
SDK downloads per weeknpm posthog-js, pypi posthog 37,733,118

SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026.

Pricing

Free tier

1M events, 5K session replays, 1M feature flag requests, 100K exceptions, 1500 survey responses per month

Cheapest plan

No monthly plan

Usage price

Usage-based pricing per product (events, replays, requests, exceptions, responses, etc.)

Plans

Added automatically: its SDK was in 90 of the public agent repos we sampled when it was added. Prices read from the official pricing page. The main repo PostHog/posthog is MIT outside ee/ (LICENSE). Privacy policy: PostHog may use customer content, aggregated or de-identified, for training its own models.

What one action costs

ActionPrice
1 analytics event beyond the free 1 million a month (1,000,001 to 2,000,000)$0.00005
1 session recording beyond the free 5,000 a month (5,001 to 15,000)$0.005
1 feature flag request beyond the free 1 million a month (up to 2,000,000)$0.0001
1 exception beyond the free 100,000 a month (100,001 to 325,000)$0.00037
1 survey response beyond the free 1,500 a month (1,501 to 2,000)$0.1
Price history
  • A year of the pricing page in the Internet Archive (11 months): the lowest monthly figure went from $250 (2025-10) to $250 (2026-08).
  • 2026-06: no longer shown $2000/mo

As reported on the official pricing page, checked Oct 9, 2026. Prices change: confirm before you buy. posthog.com/pricing

Limits

All plans, private endpoints (analytics such as insights and persons)

240 requests per minute and 1,200 per hour per personal API key

All plans, query endpoint

2,400 requests per hour

All plans, other create/read/update/delete endpoints

480 requests per minute and 4,800 per hour

All plans, event capture and flag evaluation

No request-level rate limit

All plans, request size

20 MB per request body

From the official docs. posthog.com/docs/api

Key and access

How it signs in

Project token (write-only) in the request body for capture and flags; personal API key as a Bearer token for private endpoints, or OAuth for apps other PostHog users install.

Environment variable
NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN and NEXT_PUBLIC_POSTHOG_HOST (names from the Next.js guide; the packages take the token as an argument)
Safe in browser code
Yes
Card at sign-up

No

Steps only a person can do

  • Sign up for PostHog, choose the US or EU cloud, and create a project. Copy the project token and host into .env as NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN and NEXT_PUBLIC_POSTHOG_HOST.
  • Decide on cookie consent, recording masking and the model-training opt-out for your users' data. Set opt_out_capturing_by_default or masking options in posthog.init to match that decision.
  • Only when you need more than the free allowance, add a card and set a billing limit per product. No code change; the same token keeps working.
  • Only for server-side reads (queries, local flag evaluation), create a personal API key with limited scopes. Store it as a server secret, never in browser code.

Commercial use and your data

PostHog Cloud is a paid online service with a free allowance, used under PostHog's terms. The browser package is open source under Apache 2.0, and the main code is MIT outside its "ee" folder if you host it yourself.

In a paid app
Yes

Use PostHog Cloud under PostHog's terms; the browser package is Apache-2.0.

“Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License.” source

inside-app-bundle
With conditions

Shipping posthog-js in your bundle is allowed under Apache-2.0; keep its license and notices.

“Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License.” source

redistribute-files
With conditions

Self-hosted PostHog code is MIT except the ee/ folder, which has its own license.

“All content that resides under the "ee/" directory of this repository, if that directory exists, is licensed under the license defined in "ee/LICENSE".” source

Trains on what you send

“We may use data you upload or generate through your use of PostHog to help improve PostHog's features and train our own models.”

Keeps your data

Events 1 year on free plans and 2 years on pay-as-you-go; longer with platform add-ons.

“Events are retained for 1 year on free plans and 2 years on pay-as-you-go plans.” source

Where data is stored

US cloud (Virginia) or EU cloud (Frankfurt).

“Select your cloud US (Virginia) EU (Frankfurt)” source

Errors to handle

400 invalid_project

PostHog could not tell which project the events belong to.

Check the project token and the region host; do not retry unchanged.

400 invalid_payload

The request body is not valid.

Fix the JSON body (api_key, event and distinct_id fields); do not retry unchanged.

401 invalid_api_key

The project token is wrong.

Copy the token again from the project settings.

401 invalid_personal_api_key

The personal API key used for a private endpoint is wrong or revoked.

Create or rotate the personal API key and check its scopes.

200 but the event never appears

Events without a name or distinct_id are accepted with 200 and then dropped; over-quota capture also returns 200.

Send event and distinct_id on every event, and check the quota_limited field and ingestion warnings.

Use it from an agent

Our agent check

4 of 6: llms.txt yes, OpenAPI yes, SDK yes, MCP no, status page no, AI assistants allowed yes

Checked Nov 13, 2026.

MCP server

PostHog MCP server

The server URL is https://mcp.posthog.com/mcp . The PostHog authentication server automatically routes you to the correct data region (US or EU) based on the account you log in with.

npm
npm install posthog-js
PyPI
pip install posthog

Instructions in its docs to check first

The docs say

“Installation: Use the PostHog wizard to install and configure PostHog automatically.”

The page addresses AI coding assistants and points to npx @posthog/wizard@latest, an unpinned package that signs in and changes the project. Ask the person first; prefer the manual setup from the library docs.

The docs say

“There is also a Claude Code plugin: claude plugin install posthog.”

Installing a plugin changes the person's assistant setup; ask them first.

Alternatives

PostHog This page

Free (open source)Free tier

Mixpanel

Pick Mixpanel when product analytics is the main need; it also offers session replay, experiments and feature flags.

Free planFree tier

Sentry

Pick Sentry when error tracking and performance tracing are the main need, with session replay alongside.

from $0.0003625 per errorFree tier

GrowthBook

Pick GrowthBook when you mainly need feature flags and A/B testing for product teams.

Free (open source)Free tier

All error tracking and analytics APIs

Get started

Tell your AI assistant

“Add PostHog to my Next.js app by hand (no wizard): pin posthog-js, init it with NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN and NEXT_PUBLIC_POSTHOG_HOST, call posthog.identify() after login and posthog.reset() on logout, mask form inputs in replays, and never put a personal API key in browser code.”

  1. Create a PostHog account (US or EU cloud) and copy the project token and host from the project settings.

    From posthog.com/docs/settings/projects

  2. Install the browser package (or use the HTML snippet from the docs).

    npm install --save posthog-js

    From posthog.com/docs/libraries/js.md

  3. Initialise it with your token and host; in Next.js read them from public environment variables.

    import posthog from 'posthog-js'
    
    posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN, {
      api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
      defaults: '2026-08-30'
    });

    From posthog.com/docs/libraries/next-js.md

First request

curl -v -L --header "Content-Type: application/json" -d '{
  "api_key": "<ph_project_token>",
  "event": "event name",
  "distinct_id": "user distinct id",
  "properties": {
    "account_type": "pro"
  },
  "timestamp": "[optional timestamp in ISO 8601 format]"
}' https://us.i.posthog.com/i/v0/e/

Mistakes to avoid

Putting a personal API key (phx_...) in browser code to read data from PostHog.
Use only the project token in the browser; call private endpoints from your server with the personal key.

A personal API key gives the same access as being logged into your PostHog account.

Adding posthog-js to a site with a strict Content Security Policy and not updating the policy.
Allow https://*.posthog.com in script-src and connect-src, and blob: in worker-src, or use a reverse proxy.

Blocked requests fail silently and no events arrive.

Sending events to us.i.posthog.com for a project created in the EU cloud (or the other way round).
Use the host shown in your project settings (https://eu.i.posthog.com for EU projects).

Requests must go to the domain of the region where the project lives.

Returning from a serverless function right after client.capture() in posthog-node.
await client.flush() before returning (or shutdown() when the client is no longer needed).

posthog-node queues events and sends them in batches; an unflushed queue is lost when the function stops.

Writing new server code with client.isFeatureEnabled() or getFeatureFlag() in posthog-node.
Call client.evaluateFlags() once per user and read flags.isEnabled() from the snapshot.

The old methods still work during a migration period but are deprecated.

Questions

Is there a free plan?

Yes. Every product has a free monthly allowance that resets each month, and no credit card is needed.

Can the project token be in my website code?

Yes. Capture and flag requests use the project token and return no sensitive data; private data endpoints need a personal key that stays on the server.

Where is my data stored?

In PostHog's US cloud (Virginia) or EU cloud (Frankfurt), whichever you pick, or on your own server if you self-host.

How long is data kept?

Events are kept 1 year on the free plan and 2 years on pay-as-you-go; recordings 1 month on free and 90 days on pay-as-you-go.