Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PostHog Destination docs #6976

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 33 additions & 13 deletions src/connections/destinations/catalog/posthog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ title: PostHog Destination
rewrite: true
id: 5ece242d61055a0b1bb2e103
---
[PostHog](https://posthog.com/?utm_source=segmentio&utm_medium=docs&utm_campaign=partners){:target="_blank"} is a self-hosted, open-source analytics product. Get the same powerful features as other product analytics software but keep full control over your data.
[PostHog](https://posthog.com/?utm_source=segmentio&utm_medium=docs&utm_campaign=partners){:target="_blank"} is an open-source suite of product and data tools including product analytics, session replays, feature flags, A/B testing, surveys, and more.

This destination is maintained by PostHog. For any issues with the destination, check out the [PostHog users slack](https://posthog.com/slack){:target="_blank"} or [contact the PostHog Support team](mailto:[email protected]).

## Getting Started
You can find out more about the destination in [PostHog's Segment documentation](https://posthog.com/docs/libraries/segment){:target="_blank"}.

This destination is maintained by PostHog. For any issues with the destination, ask a question in the [PostHog community](https://posthog.com/questions){:target="_blank"} or [contact the PostHog support team in-app](https://us.posthog.com/#panel=support).

## Getting started

1. From the Destinations catalog page in the Segment App, click **Add Destination**.
2. Search for "PostHog" in the Destinations Catalog, and select the PostHog destination.
3. Choose which Source should send data to the PostHog destination.
4. Go to your [PostHog set up page](https://app.posthog.com/setup){:target="_blank"}, and copy the **API key**.
5. Enter the PostHog API Key that you copied in the PostHog destination settings in Segment.
6. Enter your PostHog instance URL as the address to your instance **without any trailing slash**, for example:
- `https://app.posthog.com` if you use PostHog Cloud US
- `https://eu.posthog.com` if you use PostHog Cloud EU
- `https://posthog-example.herokuapp.com` if you self-host on Heroku
4. Go to your [PostHog project settings](https://us.posthog.com/settings/project#variables){:target="_blank"}, and copy the **project API key**.
5. Enter the project API Key that you copied in the PostHog destination settings in Segment.
6. Enter your PostHog instance address *without any trailing slash*, for example:
- `https://us.i.posthog.com` if you use PostHog US Cloud
- `https://eu.i.posthog.com` if you use PostHog EU Cloud
- Your self-hosted URL if you self-host

## Page

Expand Down Expand Up @@ -53,7 +53,7 @@ analytics.identify('userId123', {
});
```

Segment sends Identify calls to PostHog as an `identify` event. Data from Identify calls appears in PostHog under the **People** tab.
Segment sends Identify calls to PostHog as an `$identify` event. Data from Identify calls appears in PostHog under the **People** tab.


## Track
Expand All @@ -64,7 +64,7 @@ If you aren't familiar with the Segment Spec, take a look at the [Track method d
analytics.track('Login Button Clicked')
```

Segment sends Track calls to PostHog as a `track` event.
Segment sends Track calls to PostHog using the event name you provide.

## Alias

Expand All @@ -74,4 +74,24 @@ If you aren't familiar with the Segment Spec, take a look at the [Alias method d
analytics.alias('507f191e81')
```

Segment sends Alias calls to PostHog as an `alias` event.
Segment sends Alias calls to PostHog as a `$create_alias` event.

## Group

If you aren't familiar with the Segment Spec, take a look at the [Group method documentation](/docs/connections/spec/group/) to learn about what it does. An example call would look like:

```js
analytics.group("0e8c78ea9d97a7b8185e8632", {
name: "Initech",
industry: "Technology",
employees: 329,
});
```

Segment sends Group calls to PostHog as a `$groupidentify` event. This creates or updates a group with the group type `segment_group` in PostHog. To create or update a group with a different group type, call `track` with a `$group` property.

```js
analytics.track('user_signed_up', {
$groups: { company: 'Initech' }
})
```
Loading