# PostHog

> Source: https://truto.one/docs/integration-guides/posthog/

PostHog connects with a personal API key. Pick US Cloud, EU Cloud, or enter the URL of your self-hosted instance.

## Install the PostHog integration

Install PostHog from [Available integrations](https://app.truto.one/integrations/available/d98004e7-bb58-4f1d-bfc5-b52edf93741a) in each environment you connect accounts from.

## Create a personal API key

1. Sign in to PostHog and open your account settings.
2. In **Personal API Keys**, click **Create a Personal API Key**.
   ![Create a personal API key](https://docs-assets.truto.one/posthog-details-1.png)
3. Enter a label and select only the scopes for the endpoints you need.
4. Copy the key straight away. PostHog doesn't show it again.

The browser URL shows which cloud your PostHog is on.

![PostHog URL](https://docs-assets.truto.one/posthog-details-2.png)

## Connect a PostHog account

1. In [Integrated Accounts](https://app.truto.one/integrated-accounts), click **Connect Account**.
   ![Click Connect Account](https://docs-assets.truto.one/truto-connect-account.png)
2. Enter a **Tenant ID** (your customer's ID; Truto creates the tenant if it is new), or pick one under **Existing tenant (optional)**. Check the **Environment** and the **Region** (where Truto places the account; Western North America by default). To open the link straight on PostHog, pick it under **Advanced settings** → **Integration (optional)**. Click **Get connection link**.
   ![Get connection link](https://docs-assets.truto.one/truto-connect-account-modal.png)
3. Click the open-in-new-tab button, or click **Copy** and send the link to your customer so they connect their own PostHog account. The link works for 7 days, until an account is connected with it.
   ![Share connection link](https://docs-assets.truto.one/truto-connect-account-link.png)
4. Click **Get Started** if it shows, then select **PostHog**.
5. Fill in the form and click **Connect**:

   | Field | Required | What to enter |
   |---|---|---|
   | **API Key** | Yes | Your PostHog personal API key. |
   | **Base URL** | No | Where your PostHog runs. Pick one of **US Cloud**, **EU Cloud**, **Self-Hosted**. Defaults to **US Cloud**. |
   | **Self-Hosted URL** | No | Only when **Base URL** is **Self-Hosted**: your instance's URL, for example `https://posthog.acme.com`. |
6. Close the tab when you see **Connection successful**. The new account appears under **Integrated Accounts**. Click its Account ID to see its details and make API calls.
