-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6976 from ivanagas/patch-1
Update PostHog Destination docs
- Loading branch information
Showing
1 changed file
with
33 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
@@ -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 | ||
|
||
|
@@ -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' } | ||
}) | ||
``` |