Skip to content

Connect PostHog to HeyMetra

6 steps · You copy a key or the connection details from the account and paste them into HeyMetra.

Before you start

You will need:

  • Personal API key
  • Where PostHog runs
  • Your PostHog address

Steps

  1. Say whether PostHog is theirs or yours

    PostHog Cloud is the hosted one you sign in to at posthog.com. Choose your own server only if somebody at your company installed PostHog on a machine you run.

  2. If it is your own server, note its address

    The address you open PostHog at, like analytics.acme.com. On PostHog Cloud there is nothing to fill in here, and the box is not shown.

  3. Open Settings → Personal API keys

    It is under your own account menu rather than the project's settings. A personal API key belongs to you, not to one project, and reaches every project you can open.

  4. Create a key with read scopes

    Choose the scopes rather than granting everything. Reading needs Projects, Insights, Queries and Events, which PostHog lists as `project:read`, `insight:read`, `query:read` and `event:read`. Leave the write scopes off unless you intend to let your assistant propose changes.

  5. Copy the key immediately

    It starts with `phx_` and is shown once. Refreshing the page loses it, and there is no way to read it back; the only remedy is creating another one.

  6. Paste it into HeyMetra and name the connection

    On the Connections screen choose PostHog, paste the key, type the address from step one, and name the connection after the product rather than after PostHog. The key is stored encrypted and never shown again, and HeyMetra checks it works against that address before keeping it.

What you allow

Full account access

Lets your assistant read anything in this account to answer your questions. The figures are the provider's own, not ones HeyMetra has checked. It can also propose changes: none is applied until you approve it, and HeyMetra cannot undo one afterwards.

  • A personal API key reaches the projects the person who made it can open, so a project nobody shared is invisible rather than empty.
  • Event data is queried, not exported: a question spanning months of raw events is a query PostHog may refuse on time rather than a download that eventually finishes.

When it does not work

The key is rejected and it was copied correctly.
The address is the wrong one. A key issued in the EU account is not a key the US host has ever seen, and a key from a company's own installation is unknown to both. All three look like a bad key rather than a wrong address.
Sign in to PostHog, read the address out of the address bar, and edit the connection to match.
You run PostHog yourselves and it is not reachable from the internet.
HeyMetra calls your installation from its own servers. An address that only resolves inside your network, or one behind a VPN, is not an address we can reach.
Connect an installation that answers on a public address. There is no tunnel or agent to install, and nothing here can work around it.
It connects, but a question comes back with 403.
The key was made without the scope that question needs. Reading events and running a HogQL query are separate scopes, so one can work while the other does not.
Add the scope in PostHog (the 403 names it), or create a key with the read scopes and replace this one with the pencil. The connection keeps its name and everything pointing at it.
Only some of your products appear.
A personal API key reaches the projects YOU can open. A project somebody else owns and never shared is not one of them.
Ask to be added to that project in PostHog, then reconnect so the project list is read again.

Then add HeyMetra to your AI assistant

About PostHog in HeyMetra
Connect PostHog

7 days free · Set up in about 3 minutes