Set Up PostHog Analytics for Your Website
PostHog shows what visitors actually do on your site. InboundSavvy has it built in: one token, one dropdown. Includes how to connect PostHog's MCP server so your AI assistant can query the data.

Turning on PostHog takes one token and one dropdown. Everything below is that, in order, plus what to do when it does not work.
PostHog records what visitors actually do on your site: which pages they land on, where they click, and where they give up. InboundSavvy ships with it built in, so there is no code to paste and no plugin to install.
Before you start
You need a free PostHog account. When you sign up it asks whether to store your data in the US or the EU: note which you picked, because you have to match it in step 2 and nothing will arrive if you get it wrong.
Step 1 - Copy your project token
1. Log in to PostHog and open your project.
2. Go to Settings, then Project.
3. Find Project API Token and copy it. It starts with phc_.


This one is a public write key. It is designed to sit in your website's HTML where anyone can read it, so copying it around is safe. Keep that distinction in mind: the key in the MCP section further down is the opposite, and it is not safe to share.
Step 2 - Paste it into InboundSavvy
1. Open your website in the InboundSavvy dashboard and go to Global Site Settings.
2. Under Third Party IDs, paste the token into the PostHog field.
3. Set Data Region to the one you chose when you signed up.
4. Save.

That is the whole setup: one token, one region.
Step 3 - Publish
Saving stores the setting. It reaches your visitors on the next build, so click Publish. Until you do, PostHog is configured and collecting nothing.
Step 4 - Confirm it is working
1. Open your live site and click through a few pages.
2. In PostHog, open Activity.
3. Your own visit should appear within a minute or so.
Events showing up means you are done.
Good to know
- It tracks automatically. Page views and clicks are captured without you tagging anything by hand.
- It respects consent. PostHog sits behind the cookie banner, so visitors who decline analytics are not tracked.
- It is the free tier of a category that usually is not. Session replay, funnels, and heatmaps are what teams pay FullStory for. PostHog gives a small business the same instruments at a price a small business can reach.
Ask your analytics questions in plain English
PostHog runs a hosted MCP server, so the AI assistant you already use can query your analytics directly. You ask "which pages did people leave from last week" and it answers. There is nothing to install: the server is PostHog's, and you point your assistant at it.
This needs a different key from the one above. The project token is a public write key. A personal API key can read your data, so it belongs on your own machine and never in your website.
Get a personal API key
1. In PostHog, click your avatar and open Settings.
2. Find Personal API keys and click Create personal API key.
3. Name it something you will recognise in six months, for example "Claude MCP".
4. Give it read scopes only, on the one project you want to query. You are handing an assistant a key to your data: make the key open as few doors as possible.
5. Copy it. PostHog shows it once and never again.
Point your assistant at the server
Add this to your assistant's MCP configuration. For Claude Code that is ~/.claude.json; other assistants use the same shape:
{
"mcpServers": {
"posthog": {
"type": "http",
"url": "https://mcp.posthog.com/mcp",
"headers": { "Authorization": "Bearer YOUR_PERSONAL_API_KEY" }
}
}
}
Restart the assistant so it picks up the new server, then ask it something real: "what were my top ten pages last week". Numbers back means you are connected.
One caveat worth stating plainly: the assistant can only see what PostHog has already recorded. If you installed the token this morning, do not ask it about last quarter.
Not seeing any data?
- Check the token starts with phc_ and has no stray spaces.
- Check the Data Region matches the one you chose at signup. This is the common one.
- Check you published after saving.
- Check you did not decline analytics in your own cookie banner. Everybody does this once.












