Set Up Free PostHog Analytics

Connect PostHog to your InboundSavvy site with one key, filter out your own visits, and build the weekly graph that shows whether real people are arriving. Includes PostHog's MCP server for asking your AI assistant about the data.

Set Up PostHog Analytics

PostHog shows what visitors do on your site: which pages they land on, where they click, and where they leave. It is free for up to a million events and 5,000 session recordings a month, with no credit card, and InboundSavvy has it built in, so there is no code to paste.

This guide connects it, keeps your own visits out of the numbers, and builds the one graph worth watching while a site is new.

Before you start

Create a free account at posthog.com. When you sign up it asks whether to store your data in the US or the EU. Note which you picked: you match it in step 2, and nothing arrives if the two differ.

Step 1 - Copy your project key

1. Log in to PostHog and open your project.
2. Go to Settings, then Project.
3. Copy the project API key. It starts with phc_.

PostHog Settings screen with the Project section selected in the sidebarThe Project API Token field in PostHog, showing a token that 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. 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 Console and click Settings in the sidebar.
2. Open Global Settings and scroll to Third-party integrations.
3. Paste the key into PostHog Project API Key. The Paste button beside the field does it for you.
4. Set PostHog Data Region to the region you chose at signup.

InboundSavvy Global Site Settings, with the PostHog token and data region filled in

There is no Save button. Changes save on their own within a minute, or as soon as you leave the page.

Step 3 - Publish

Saving stores the setting. Visitors get it on the next build: on your site's Overview, under Changes and publish, click Build preview, then Publish live. Until the live build finishes, PostHog is set up and records nothing.

Step 4 - Confirm it is working

1. Open your live site and click Accept all on the cookie banner.
2. Click through a few pages.
3. In PostHog, open Activity. Your visit appears within a minute or so.

PostHog starts only after a visitor allows analytics cookies. Anyone who clicks Essential only is never recorded, and that includes you.

Not seeing any data?

- Check the key 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 clicked Publish live after saving.
- Check you clicked Accept all on your own banner. Everybody misses this once.
- Check Cookie consent is switched on in Global Settings. PostHog waits for the banner, so with the banner off it never starts.

Step 5 - Leave yourself out

On a new site you are often the busiest visitor. Every page you check counts as a visitor unless PostHog knows it is you. There are two parts: mark your own browser, then tell PostHog to leave marked visits out.

Mark your own browser

1. Open your live site in the browser you normally use and click Accept all.
2. Open the browser console: press F12, or Ctrl+Shift+J on Windows, or Cmd+Option+J on a Mac, and click the Console tab.
3. Paste this line and press Enter:

posthog.setPersonProperties({ internal_user: true })

Chrome may ask you to type allow pasting first. Type it, press Enter, then paste the line again.

The mark lives in that browser's cookies. Repeat it on each computer and browser you use, and again if you clear your cookies. Visits from before the mark still count, so mark first and browse after. A phone has no console: on your phone, click Essential only on your own banner instead, and PostHog never records it.

Tell PostHog to leave them out

1. In PostHog, go to Settings, then Project, and find Filter out internal and test users.
2. Add a filter: pick the person property internal_user and the operator is not set.
3. Turn on Enable this filter on all new insights.
4. Save.

The filter describes who to keep: everyone without the mark. internal_user shows up in the property list once PostHog has seen one marked visit, so mark your browser first. Web analytics has its own switch for the same filter at the top of the page, Filter test accounts. Turn that on too.

Step 6 - Build your first graph

While a site is new the question is simple: are real people arriving, and where from? One graph answers it.

1. In PostHog, open Product analytics, click New insight, and choose Trends.
2. For the series, pick Pageview and change Total count to Unique users.
3. Set the date range to Last 90 days and the interval to Week.
4. Under Breakdown, pick the session property Entry referring domain.
5. Check that Filter out internal and test users is on.
6. Click Save, name it Real visitors per week, and add it to a dashboard.

Read it each week

Each point is the number of different people who visited that week, with you left out. The breakdown shows where each visit started: $direct means they typed the address or used a bookmark, www.google.com means they searched. While Google is still indexing a new site, expect a few visitors a week, most of them direct.

The line to watch is search. When www.google.com shows up week after week, people are finding you on their own. If it has not appeared after a month or two, start with how to get Google to index a new site.

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 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 key 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 recognize 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: the assistant can only see what PostHog has already recorded. If you added the key this morning, do not ask it about last quarter. The filter from step 5 applies here too, so ask it to filter out internal and test users.