Overview
The PostHog integration sends your Appstack attribution data and conversion events to your PostHog project, so you can analyze installs, revenue and campaign performance next to your product analytics.
| Item | Details |
|---|
| Direction | Appstack to PostHog |
| Events | Every event you select, including appstack_install, sent through the Batch Capture API with event names prefixed appstack_ |
| Revenue | Sent with any event that carries a value: revenue in the event’s own currency, gross of store fees, plus currency and revenue_usd |
| Attribution data | Media source, campaign, ad set, ad, install type, matching details, country and app, sent as event properties |
| Event scope | Event selector. All selected events are sent, organic installs included |
| Regions | US and EU PostHog Cloud projects |
| Delivery | Scheduled sync about once an hour, not real time |
How it works
Appstack sends events to the PostHog Batch Capture API on a schedule: https://us.i.posthog.com/batch/ for US projects and https://eu.i.posthog.com/batch/ for EU. Appstack authenticates with your project API key.
Installs and all other events go through the same endpoint, in batches of up to 1,000. Each event carries a stable uuid, so PostHog can deduplicate an event that Appstack has to send again. A rejected batch is retried up to three times, and anything that still fails is picked up on the next sync.
Revenue is sent as a decimal amount in major units (for example 4.99, not cents), so it displays correctly under PostHog’s default revenue setting. You do not need to turn on a “values are in cents” option.
Events and properties
| Event | What it is |
|---|
appstack_install | A new install, attributed to a campaign or marked organic |
appstack_ + event name | Any other event selected in the console, named in lowercase, for example appstack_purchase. Events with a value also carry revenue |
Each event has the top-level fields event, timestamp (ISO 8601) and uuid, and the properties below. A property with no value is left out. Appstack does not update PostHog person properties: attribution data lives on the Appstack events only.
| Property | Value |
|---|
distinct_id | The Appstack ID of the installation |
event_id | Unique Appstack event identifier |
media_source | The ad network, for example meta, or organic |
campaign_id, campaign_name | Campaign ID and name |
adset_id, adset_name | Ad set ID and name |
ad_id, ad_name | Ad ID and name |
matching_type | How the event was matched to an ad click, for example network, geo, coordinates, exact_ip or city_region |
click_to_first_open_hours | Hours between the attributed click and the event. Absent when there is no click |
confidence_score | Attribution confidence: low, medium or high |
country | Country of the install or event |
os | ios or android |
app_id | Your app’s Appstack app ID: the App Store ID (numbers only) on iOS, the package name on Android |
app_name | Your app’s display name |
install_type | iOS install classification, for example new_install or reinstall_same_device. Absent on Android |
customer_user_id | Your own user ID, when you pass customerUserId to the Appstack SDK |
idfv, maid, app_set_id | Device identifiers: IDFV on iOS, the advertising ID (IDFA on iOS, GAID on Android) and, on Android, the App Set ID |
revenue, currency, revenue_usd | Events with a value only. revenue is the gross amount, before store fees, in currency. revenue_usd is converted at the exchange rate of the event date |
How users are matched
Appstack sets distinct_id to the Appstack ID of the installation on every event, so events merge onto the PostHog person that already uses that ID. This requires your PostHog SDK to identify users with the Appstack ID. Otherwise Appstack events appear as separate persons.
Your own user ID is never used as distinct_id. It is sent as the customer_user_id property when you pass customerUserId to the Appstack SDK.
Setup
- In PostHog, open Project settings and copy the Project API key.
- In the Appstack console, open the Integrations page of your project and select PostHog.
- In the Credentials section, select the region of your PostHog project (United States or European Union) and paste your API key. The key can only contain letters, numbers and underscores.
- Connect the integration.
- In the Events to forward section, choose which events to send, as described below, and save.
- Optional but recommended: pass your own user ID as
customerUserId when you configure the Appstack SDK.
An app forwards its events to one analytics destination at a time (Amplitude, Mixpanel or PostHog). Disconnect the current one before connecting another.
Choose which events to send
Pick the events you want in PostHog from the events Appstack has received for your app: SDK events, server-to-server events and subscription events from connected providers such as RevenueCat. The install event is always sent and cannot be removed. A new connection sends only the install event until you save a selection.
Each event Appstack sends counts toward your PostHog event volume. If you only need installs and campaign data in PostHog, select only the install event. PostHog has no attributed-only switch: events of organic installs are sent too.
Sample payload
This is the body of one Batch Capture request. All values are placeholders, and appstack_purchase stands for any event your app tracks.
Limitations and troubleshooting
- Events from before you connect are not sent. The first sync only sets the starting point. Appstack sends events that arrive after it.
- Appstack events show up as separate persons. Appstack uses its own install ID as
distinct_id. Identify your users in PostHog with the Appstack ID to merge them.
- Campaign, ad set and ad names can be missing. Names are only present when an ad network integration has resolved them. The IDs are sent whenever Appstack has them.
- Device identifiers are sent as event properties.
idfv, maid and app_set_id are included when available.
- Sync is not real time. Appstack syncs about once an hour, so new events can take over an hour to appear in PostHog.