How it works
When a visitor takes an action on your store, Upstack:- Captures the event through the Upstack Pixel and matches it to a known visitor profile using Upstack’s identity resolution.
- Enriches the event with identity data (distinct ID, email, IP, user agent, device info).
- Sends the event to PostHog using your Project API Key via the PostHog Capture API.
- PostHog records the event against the visitor’s distinct ID for analytics, funnels, and session replays.
Set up PostHog
Get your PostHog Project API Key
phc_ followed by alphanumeric characters.Note your data region
- US — Data hosted in the United States (
us.posthog.com) - EU — Data hosted in the European Union (
eu.posthog.com)
Add the destination in Upstack
- Project API Key — Your PostHog project API key (starts with
phc_) - Data Region — Select US or EU based on your PostHog project location
Optional: Configure additional settings
- Enable Auto Capture — Automatically capture pageviews and clicks
- Enable Session Recording — Enable session recording for user replays (requires PostHog session recording to be configured)
Credentials
| Field | Required | Description |
|---|---|---|
| Project API Key | Yes | Your PostHog project API key. Found in Project Settings → Project API Key. Starts with phc_. |
| Data Region | Yes | The region where your PostHog data is hosted: US or EU. |
| Enable Auto Capture | No | Automatically capture pageviews and clicks. |
| Enable Session Recording | No | Enable session recording for user replays. |
Event mapping
Upstack automatically maps e-commerce events to PostHog events with enriched properties.| Upstack event | PostHog event | Description |
|---|---|---|
PageView | $pageview | Page view on any storefront page |
ViewContent | view_item | Product detail page view |
ViewCategory | view_category | Category or collection page view |
ViewCart | $pageview | Cart page view |
AddToCart | add_to_cart | Product added to cart |
InitiateCheckout | initiate_checkout | Checkout started |
Purchase | purchase | Order completed |
Search | search | Search performed on storefront |
SignUp | sign_up | Account created |
Lead | lead | Lead form submitted |
Event properties
Each event sent to PostHog includes enriched properties from Upstack’s identity resolution:| Property | PostHog field | Description |
|---|---|---|
| Distinct ID | distinct_id | Upstack identity ID (resolved across sessions) |
| Current URL | $current_url | Page URL where the event occurred |
| Referrer | $referrer | Referring URL |
| IP Address | $ip | Visitor IP address |
| User Agent | $user_agent | Browser user agent string |
| Browser | $browser | Browser name |
| Device Type | $device_type | Device type (desktop, mobile, tablet) |
| Operating System | $os | Operating system name |
email | Customer email (when identified) |
E-commerce properties
For purchase and cart events, additional e-commerce properties are included:| Property | Description |
|---|---|
value | Total value of the event |
currency | Currency code (e.g., USD) |
order_id | Order ID (for purchases) |
search_query | Search query (for search events) |
items | Array of product items with product_id, product_name, product_brand, product_category, price, quantity, and variant |
FAQ
What is the difference between Upstack and PostHog's native Shopify integration?
What is the difference between Upstack and PostHog's native Shopify integration?
How does Upstack identify users in PostHog?
How does Upstack identify users in PostHog?
distinct_id to each visitor. This ID persists across sessions, devices, and browsers when Upstack can resolve the visitor’s identity. Anonymous visitors receive a temporary ID that Upstack attempts to merge when the visitor is later identified.Will I see duplicate events if I also have PostHog installed via another method?
Will I see duplicate events if I also have PostHog installed via another method?
How quickly do events appear in PostHog?
How quickly do events appear in PostHog?
Can I use PostHog session recordings with Upstack?
Can I use PostHog session recordings with Upstack?
Troubleshooting
Events not appearing in PostHog
Events not appearing in PostHog
- Confirm the PostHog destination shows Active (green) in the Upstack dashboard
- Verify your Project API Key is correct and starts with
phc_ - Check that you selected the correct data region (US or EU) matching your PostHog project
- In PostHog, go to Activity → Live Events and look for events from Upstack
- If the destination status is red, disconnect and reconnect with a fresh API key
Events showing with wrong distinct_id
Events showing with wrong distinct_id
- Verify Upstack’s identity resolution is working by checking the Live Event Stream for resolved identities
- Check that your PostHog project’s person identification settings match how Upstack sends distinct IDs
- Allow 24-48 hours for Upstack to build identity profiles for new visitors