Skip to main content
SamCart → PostHogIntegration guide

Connecting SamCart to PostHog

SamCart is a checkout platform built for conversion optimisation, which means order bumps and upsells are the point — and they complicate the value on every order. 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 SamCart 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

SamCart in PostHog: join the sales page funnel to the order

Append the PostHog distinct_id to the SamCart checkout link, store it in a hidden custom field, and capture the purchase server-side from the order webhook on that ID. Capture front-end purchase, bump and each upsell separately with product and price, identify buyers later with your platform user ID, use event UUIDs from the SamCart order ID, and capture refunds.

PostHog shows what visitors do on your sales pages, and SamCart knows what they paid, but the two never meet on their own: the PostHog distinct_id lives on your domain, and the buyer completes checkout on SamCart's. Append the distinct_id to the SamCart checkout link, store it in a hidden custom field, and capture the purchase server-side from the order webhook on that same distinct_id. Then video watched, page scrolled and order placed form one person's path rather than two disconnected datasets.

Capture the front-end purchase, the order bump and each upsell as separate events with product and price, so you can see which sales-page behavior predicts upsell take-rate, not only checkout. Once the buyer creates an account in your course or membership platform, identify them with that user ID so the anonymous distinct_id merges, and product usage after purchase connects back to the funnel that sold it.

Give each captured purchase an event UUID derived from the SamCart order ID; a webhook retried after an outage on a self-hosted instance otherwise doubles revenue in every insight. PostHog is the place to analyze the funnel, not to feed ad platforms, so send ad conversions separately with their own identifiers. Capture refunds as their own event so you can compare refund rates by sales-page variant.

SamCart → PostHog · what breaks

Why this join usually fails — SamCart → PostHog

  1. 01

    The distinct_id never reaches SamCart

    SamCart hosts the checkout, so the identifier has to be passed through its URL parameters or custom fields. The upsell flow adds a further step after the initial purchase, which can create additional orders that should not each count as a new acquisition.

  2. 02

    Upsells counted as separate acquisitions

    A funnel with two upsells can produce three orders from one customer. Counted as three conversions, the campaign looks three times better than it is.

  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.

SamCart → PostHog · the fix

What working looks like — SamCart → 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

SamCart → PostHog · architecture

How SamCart and PostHog actually connect

  1. 1

    SamCart holds the truth

    The headline product price is rarely what the customer paid. Order bumps and one-click upsells are the platform's core feature, so the order total and the product price routinely differ substantially.

  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 SamCart order.

  4. 4

    The event source decides reliability

    Send the initial purchase as the acquisition conversion at the full realised value including bumps, and treat one-click upsells as additional revenue against the same customer rather than as new acquisitions.

  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.

SamCart → PostHog · normal or broken

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

Normal, not a fault

  • The distinct_id present on the order

  • Sent from the SamCart 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

    SamCart hosts the checkout, so the identifier has to be passed through its URL parameters or custom fields. The upsell flow adds a further step after the initial purchase, which can create additional orders that should not each count as a new acquisition.

  • Sent from the browser

    A funnel with two upsells can produce three orders from one customer. Counted as three conversions, the campaign looks three times better than it is.

  • 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

SamCart → PostHog · diagnose

Diagnostic order — SamCart → PostHog

  1. 01

    Count orders carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Follow one purchase with upsells through to the conversions sent

    If three orders produced three acquisition conversions, you have found the inflation.

  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.

SamCart → PostHog · prove

How it gets proven — SamCart → PostHog

Source of truth

SamCart's order records for the same window, including bumps and upsells.

  • 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.
  • A purchase with two upsells confirmed to produce one acquisition conversion at the combined value.

SamCart → PostHog · free audit

What we check in the free audit

  • Count orders carrying the distinct_id
  • Follow one real conversion end to end
  • Follow one purchase with upsells through to the conversions sent
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

SamCart's order records for the same window, including bumps and upsells.

Get my free conversion tracking audit

Free30 minutesNo obligation

SamCart → PostHog · when not to buy

When you don't need this — SamCart → PostHog

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the distinct_id.
  • If you run a single product with no bumps or upsells, the standard checkout approach applies and none of this complexity is relevant.
  • 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.

SamCart → PostHog · what we deliver

What gets built — SamCart → PostHog

  • Identifier capture into SamCart

    Pass the identifier into the SamCart checkout URL and confirm it lands on the order, then decide how upsell orders relate to the parent purchase before sending anything.

  • Event source: the SamCart order webhook

    Send the initial purchase as the acquisition conversion at the full realised value including bumps, and treat one-click upsells as additional revenue against the same customer rather than as new acquisitions.

  • 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 are recorded and, on aggressive upsell funnels, refund rates are high enough that ignoring them materially overstates performance.

Written guarantee

95%+ tracking accuracy

Measured against SamCart's order records for the same window, including bumps and upsells.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

SamCart → PostHog questions, answered

Pass the PostHog distinct_id into the SamCart checkout URL, store it on the order, and capture the purchase server-side with that distinct_id.

Free · 30 min

Get SamCart and PostHog joined properly

Free30 minutesNo obligation