Skip to main content
Data direction: This is a destination — Upstack sends event and conversion data out to this platform via server-side APIs.
PostHog is an open-source product analytics platform. Upstack forwards enriched e-commerce events to PostHog so you can analyze customer behavior, track conversion funnels, and replay user sessions — all powered by Upstack’s identity resolution.

How it works

When a visitor takes an action on your store, Upstack:
  1. Captures the event through the Upstack Pixel and matches it to a known visitor profile using Upstack’s identity resolution.
  2. Enriches the event with identity data (distinct ID, email, IP, user agent, device info).
  3. Sends the event to PostHog using your Project API Key via the PostHog Capture API.
  4. PostHog records the event against the visitor’s distinct ID for analytics, funnels, and session replays.
The result: unified product analytics where anonymous visitors are resolved to their identities, giving you cleaner funnels and more complete user journeys.

Set up PostHog

1

Get your PostHog Project API Key

In PostHog, go to Project Settings → Project API Key. The key starts with phc_ followed by alphanumeric characters.
2

Note your data region

PostHog offers two data regions:
  • US — Data hosted in the United States (us.posthog.com)
  • EU — Data hosted in the European Union (eu.posthog.com)
Select the region that matches where your PostHog project is hosted.
3

Add the destination in Upstack

In the Upstack dashboard, go to Destinations → Add Destination → PostHog. Enter:
  • Project API Key — Your PostHog project API key (starts with phc_)
  • Data Region — Select US or EU based on your PostHog project location
4

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)
5

Save and verify

Save the destination. Visit your store, trigger an event (view a product, add to cart), and verify the event appears in PostHog under Activity → Live Events.

Credentials

FieldRequiredDescription
Project API KeyYesYour PostHog project API key. Found in Project Settings → Project API Key. Starts with phc_.
Data RegionYesThe region where your PostHog data is hosted: US or EU.
Enable Auto CaptureNoAutomatically capture pageviews and clicks.
Enable Session RecordingNoEnable session recording for user replays.

Event mapping

Upstack automatically maps e-commerce events to PostHog events with enriched properties.
Upstack eventPostHog eventDescription
PageView$pageviewPage view on any storefront page
ViewContentview_itemProduct detail page view
ViewCategoryview_categoryCategory or collection page view
ViewCart$pageviewCart page view
AddToCartadd_to_cartProduct added to cart
InitiateCheckoutinitiate_checkoutCheckout started
PurchasepurchaseOrder completed
SearchsearchSearch performed on storefront
SignUpsign_upAccount created
LeadleadLead form submitted

Event properties

Each event sent to PostHog includes enriched properties from Upstack’s identity resolution:
PropertyPostHog fieldDescription
Distinct IDdistinct_idUpstack identity ID (resolved across sessions)
Current URL$current_urlPage URL where the event occurred
Referrer$referrerReferring URL
IP Address$ipVisitor IP address
User Agent$user_agentBrowser user agent string
Browser$browserBrowser name
Device Type$device_typeDevice type (desktop, mobile, tablet)
Operating System$osOperating system name
EmailemailCustomer email (when identified)

E-commerce properties

For purchase and cart events, additional e-commerce properties are included:
PropertyDescription
valueTotal value of the event
currencyCurrency code (e.g., USD)
order_idOrder ID (for purchases)
search_querySearch query (for search events)
itemsArray of product items with product_id, product_name, product_brand, product_category, price, quantity, and variant

FAQ

PostHog’s native integration only sees visitors that Shopify can identify. Upstack’s identity resolution matches anonymous sessions to known customer profiles using cookies, click IDs, and cross-session behavioral data. This means your PostHog funnels and cohorts include visitors that would otherwise be anonymous.
Upstack uses its identity resolution engine to assign a consistent 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.
Possibly. If you have PostHog’s JavaScript snippet or another integration sending the same events, you may see duplicates. Consider disabling overlapping event types in either Upstack or your other PostHog integration to avoid duplication.
Events typically appear in PostHog within 1-2 minutes of occurring on your storefront. Check Activity → Live Events in PostHog to verify events are arriving.
PostHog session recordings require PostHog’s JavaScript snippet to be installed on your storefront. Upstack sends server-side events to PostHog, which can be correlated with session recordings if you have both installed. Enable “Session Recording” in the Upstack destination settings to include session replay metadata.

Troubleshooting

If events are showing in the Upstack Live Event Stream but not arriving in PostHog:Steps to fix:
  1. Confirm the PostHog destination shows Active (green) in the Upstack dashboard
  2. Verify your Project API Key is correct and starts with phc_
  3. Check that you selected the correct data region (US or EU) matching your PostHog project
  4. In PostHog, go to Activity → Live Events and look for events from Upstack
  5. If the destination status is red, disconnect and reconnect with a fresh API key
If events appear in PostHog but users aren’t being properly identified:Steps to fix:
  1. Verify Upstack’s identity resolution is working by checking the Live Event Stream for resolved identities
  2. Check that your PostHog project’s person identification settings match how Upstack sends distinct IDs
  3. Allow 24-48 hours for Upstack to build identity profiles for new visitors
For additional troubleshooting beyond PostHog-specific issues, see Troubleshooting: Events Not Reaching Destination.

Identity Resolution

How Upstack ID connects anonymous sessions to known customers.

Destinations Overview

How Upstack Signal and Upstack Flows power different types of destinations.

Custom Events

Send custom events to PostHog and other destinations.

Events Not Reaching Destination

End-to-end diagnostic guide when events aren’t arriving at any destination.