> ## Documentation Index
> Fetch the complete documentation index at: https://doc.indexbrain.online/llms.txt
> Use this file to discover all available pages before exploring further.

# PostHog

> Connect PostHog to analyze product usage — event counts, top pages, funnels, and retention.

Connect Indexbrain to PostHog to analyze product usage using natural language — read-only, real server-side aggregates.

## Setup

<Steps>
  <Step title="Create a personal API key">
    In PostHog, go to **Settings > Account > Personal API Keys** and create one with read access. The project API key (used for sending events) won't work here — Indexbrain needs the personal key to read data.
  </Step>

  <Step title="Go to Integrations">
    Navigate to **Settings > Integrations > PostHog**.
  </Step>

  <Step title="Add your credentials">
    Enter your personal API key and host (e.g. `https://us.i.posthog.com` for US Cloud, `https://eu.i.posthog.com` for EU Cloud, or your self-hosted domain).
  </Step>

  <Step title="Test the connection">
    Ask about your top events.
  </Step>
</Steps>

<Note>
  Your project is resolved automatically after connecting — no project ID
  to enter manually.
</Note>

## Capabilities

### Event volume

```
What were my top 10 events last week?
```

Real aggregate counts, computed server-side by PostHog — not a sample of recent events counted after the fact.

### Top pages

```
Which pages get the most pageviews this month?
```

Returns the top 15 pages by pageview count.

### Funnels

```
Build a funnel from signup to first purchase
```

Returns the count and conversion-from-start percentage at each step of an ordered sequence of events (2-6 steps).

<Note>
  This is a straightforward sequential-event funnel, not PostHog's full UI
  funnel builder — it doesn't support exclusion steps or breakdowns.
</Note>

### Retention

```
Show 30-day retention for new users
```

Returns a single Day-N retention percentage: of people who did a given event within a date range, what percent did the event again exactly N days later.

<Note>
  This is one retention number for the day you ask about, not PostHog's
  full multi-period retention grid (Day 1, 2, 3... N all shown at once).
</Note>

## What Indexbrain does not do in PostHog (yet)

* **No exclusion steps or breakdowns in funnels.**
* **No full multi-period retention grid** — only a single Day-N percentage per question.
* **No individual user-level data, session recordings, or feature flag configs.**

## How data moves

Usage data is captured as one daily snapshot rather than individual events — it's a trend signal. Snapshots sync on your configured processing interval; asking a question can also trigger a live query for the exact date range you ask about.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection fails or returns no data">
    * Confirm you used a **personal** API key, not the project API key from Settings > Project — the project key can only send events, not read them.
    * Confirm the host matches where your PostHog project actually lives (US Cloud, EU Cloud, or self-hosted).
  </Accordion>

  <Accordion title="A funnel or retention question gives an unexpected answer">
    * Confirm the event names you used match exactly how they're named in PostHog (event names are case-sensitive).
    * Remember funnels don't support exclusions/breakdowns, and retention is a single Day-N number, not a full grid.
  </Accordion>
</AccordionGroup>
