> ## Documentation Index
> Fetch the complete documentation index at: https://www.edgee.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PostHog

> Built successful products by analyzing, testing, and observing product usage with PostHog, **now at the edge**.

<img src="https://mintcdn.com/edgee/enlt_qUyIUJ64Dg-/images/banners/posthog.png?fit=max&auto=format&n=enlt_qUyIUJ64Dg-&q=85&s=0945b23a0812090c4eace6e397680ed3" className="rounded-lg" noZoom width="1312" height="334" data-path="images/banners/posthog.png" />

Find it on GitHub: [<Icon icon="github" iconType="solid" /> /edgee-ai/posthog-component](https://github.com/edgee-ai/posthog-component)

PostHog is the all-in-one platform for product analytics, feature flags, session replays, experiments, and surveys that's built for developers.
This components lets you collect and forward analytics events to your PostHog instance.

## Event Mapping

Here's how Edgee events map to PostHog events:

| Edgee Event | PostHog Event   | Description                         |
| ----------- | --------------- | ----------------------------------- |
| Page        | `$pageview`     | pageview event with url as property |
| Track       | Your event name | A event with your custom event name |
| User        | `$identify`     | Sets all the data for the user      |

## Getting Started

**To integrate PostHog into your Edgee project:**

1. Open the Edgee console and navigate to your project's Components.
2. Select "Add a component" and choose `edgee/posthog` from the list of available components.
3. Enter your PostHog Region, API Key and click Save. <br />
4. Once the component has been configured, you are ready to send analysis events to PostHog.

## Component Name

When configuring the component in your **Edgee Data Layer** or within SDK calls, use `edgee/posthog` as the component name:

```json theme={"dark"}
{
  "components": {
    "edgee/posthog": true
  }
}
```
