# PostHog

Open source product analytics platform

- Category: Analytics
- Runs in: the Phloem cloud

Lets you and Hamming query a PostHog project's events and persons in HogQL.

## What you need
- The PostHog project ID (in Project Settings)
- A PostHog API key with access to that project
- For a self-hosted instance: its full URL, reachable from Phloem's cloud

## Connect
1. In the console, open **Connectors**, choose **Add connector**, then **PostHog**.
2. Enter a **Display Name** and **Project ID**.
3. Under **Hosting Type**, choose **PostHog Cloud (US)**, **PostHog Cloud (EU)** or **Self-hosted**. For **Self-hosted**, enter **Self-hosted URL** without a trailing slash.
4. Choose **Test Connection** (it checks the API key and project), then **Create Connection**.

## What Hamming can do
- Run HogQL that you or Hamming write over PostHog's `events` and `persons` tables, e.g. `SELECT event, count() FROM events GROUP BY event`

Phloem only reads from PostHog.

## Connection fields

| Field | Type | Required | Notes |
|---|---|---|---|
| Project ID | Text | Yes | PostHog Project ID (found in Project Settings) |
| Hosting Type | One of | No | Where your PostHog instance is hosted |
| Self-hosted URL | Text | No | Full URL to your PostHog instance (without trailing slash) |
