Skip to main content
SureCart → PostHogIntegration guide

Connecting SureCart to PostHog

SureCart runs checkout off-site while the store lives in WordPress, which removes the database load and introduces a handoff where the identifier can be lost. PostHog can be self-hosted, which changes the calculus entirely: the data stays on infrastructure you control, and so does the responsibility for everything that goes wrong with it. The join between them succeeds or fails on one thing: whether the distinct_id reaches the SureCart order before the conversion happens, because PostHog can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

PostHog funnels from WordPress pages to SureCart orders

Pass the PostHog distinct_id into SureCart checkout metadata, then capture paid orders from the webhook with that distinct_id, total, products and an event UUID derived from the order number for deduplication. Send renewals and cancellations for subscriber retention. Identify logged-in customers with their WordPress account ID and alias earlier anonymous IDs to merge devices.

PostHog can follow a visitor across your WordPress pages, but the SureCart order is processed by SureCart's platform, so the purchase step disappears from the funnel unless you send it yourself. Pass the visitor's PostHog distinct_id into the SureCart checkout as metadata, then capture the order server-side from the paid-order webhook with that same distinct_id, the order total and products.

Give each server event a UUID derived from the SureCart order number, so a retried webhook does not count the purchase twice; PostHog deduplicates on that UUID. For subscriptions, send renewal and cancellation events with the same distinct_id, which makes PostHog's retention view show paying-subscriber retention rather than page-visit retention.

Identity is the gap. A buyer who browsed on a phone and purchased on a laptop has two distinct_ids, and the order only joins the laptop's history. If your store creates WordPress accounts for customers, identify the visitor with the account ID when they log in to the customer area, and alias their earlier anonymous ID to it, so later purchases and logins merge. Stores where buyers never log in will see more single-session funnels than really exist.

SureCart → PostHog · what breaks

Why this join usually fails — SureCart → PostHog

  1. 01

    The distinct_id never reaches SureCart

    Checkout runs on SureCart's infrastructure, so the identifier must be passed at the handoff rather than read from the page.

  2. 02

    Order data living outside the site it belongs to

    Teams used to querying the WooCommerce orders table find nothing in the database, because the orders are not there. Reconciliation has to go through the API, and assuming otherwise wastes a day.

  3. 03

    Self-hosting the analytics and the outage together

    The advantage of owning the pipeline is that nothing blocks it. The cost is that when the ingestion instance fills its disk on a Saturday, the events are gone and nobody is paged. Hosted tools fail differently and more visibly.

  4. 04

    Nothing reconciles afterwards

    PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.

SureCart → PostHog · the fix

What working looks like — SureCart → PostHog

  • The distinct_id on every order

  • Conversions arriving in PostHog

    The event lands on the person profile and becomes available in insights, funnels and session replay.

  • Reconciled against the source

SureCart → PostHog · architecture

How SureCart and PostHog actually connect

  1. 1

    SureCart holds the truth

    Because the cart is hosted rather than in WordPress, the order data lives outside your database and must be pulled rather than queried.

  2. 2

    PostHog needs a click to match

    PostHog needs a distinct_id, an event name and its properties. Self-hosted instances additionally need the ingestion endpoint reachable and the project API key correct, which is a class of failure hosted tools do not have.

  3. 3

    The identifier is the bridge

    The distinct_id, captured at the visit and carried into the SureCart order.

  4. 4

    The event source decides reliability

    Send completed orders at paid value, with subscriptions sending only the first payment.

  5. 5

    Deduplication at the destination

    PostHog deduplicates on the event UUID where supplied. Without one, a retried batch duplicates, and on a self-hosted instance there is no vendor support desk to notice it for you.

SureCart → PostHog · normal or broken

Working vs. broken, side by side — SureCart → PostHog

Normal, not a fault

  • The distinct_id present on the order

  • Sent from the SureCart order webhook

  • Deduplicated correctly

    PostHog deduplicates on the event UUID where supplied. Without one, a retried batch duplicates, and on a self-hosted instance there is no vendor support desk to notice it for you.

  • Reconciles with the source

Actually broken

  • The distinct_id missing on most records

    Checkout runs on SureCart's infrastructure, so the identifier must be passed at the handoff rather than read from the page.

  • Sent from the browser

    Teams used to querying the WooCommerce orders table find nothing in the database, because the orders are not there. Reconciliation has to go through the API, and assuming otherwise wastes a day.

  • Counted twice, or not at all

    The advantage of owning the pipeline is that nothing blocks it. The cost is that when the ingestion instance fills its disk on a Saturday, the events are gone and nobody is paged. Hosted tools fail differently and more visibly.

  • Nobody has reconciled it

SureCart → PostHog · diagnose

Diagnostic order — SureCart → PostHog

  1. 01

    Count orders carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Confirm where the order record actually lives before designing reconciliation

    On hosted-checkout plugins it is not in WordPress, and that changes the whole approach.

  4. 04

    Check ingestion health and disk before debugging any missing event

    On self-hosted instances the answer is infrastructure far more often than it is instrumentation.

  5. 05

    Read the match rate, not the success message

    PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.

SureCart → PostHog · prove

How it gets proven — SureCart → PostHog

Source of truth

SureCart orders by date, split into one-time and subscription purchases.

  • The distinct_id confirmed present on a live order.
  • Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
  • Completed orders reconciled from the API against imported conversions.

SureCart → PostHog · free audit

What we check in the free audit

  • Count orders carrying the distinct_id
  • Follow one real conversion end to end
  • Confirm where the order record actually lives before designing reconciliation
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

SureCart orders by date, split into one-time and subscription purchases.

Get my free conversion tracking audit

Free30 minutesNo obligation

SureCart → PostHog · when not to buy

When you don't need this — SureCart → PostHog

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the distinct_id.
  • If you use a fully in-database cart, you can query directly and this indirection does not apply.
  • If you have no reason to keep the data on your own infrastructure and no team to run it, the hosted product removes the only real downside of this one.

SureCart → PostHog · what we deliver

What gets built — SureCart → PostHog

  • Identifier capture into SureCart

    Capture on your WordPress site and pass the identifier into the checkout session as metadata.

  • Event source: the SureCart order webhook

    Send completed orders at paid value, with subscriptions sending only the first payment.

  • Dispatch to PostHog

    The PostHog capture API, posted server-side from your backend to your own instance or to PostHog Cloud.

  • Reversals where they exist

    Refunds and cancellations reverse.

Written guarantee

95%+ tracking accuracy

Measured against SureCart orders by date, split into one-time and subscription purchases.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

SureCart → PostHog questions, answered

Pass the PostHog distinct_id into the SureCart checkout as metadata and capture the order server-side from the paid-order webhook with that distinct_id.

Free · 30 min

Get SureCart and PostHog joined properly

Free30 minutesNo obligation