Skip to main content
Loop → PostHogIntegration guide

Connecting Loop Returns to PostHog

Loop is built to turn returns into exchanges rather than refunds, which means the outcome of a return is a decision with three different revenue consequences. 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 Loop return 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

Loop Returns in PostHog: which journeys produce returns

Store the PostHog distinct_id on the Shopify order at checkout, then capture a server-side event when Loop closes the return, with outcome, item and reason as properties and an event UUID from the Loop return ID and status. Don't install the snippet on Loop's portal. Use it to analyze which journeys precede exchanges, not to reconcile net revenue.

PostHog is where you can answer the product question Loop raises: which landing pages, product views and size-guide behaviours precede an exchange rather than a keep. That only works if the return lands on the same distinct_id as the session that bought. Store the distinct_id on the Shopify order at checkout, then capture a server-side event when Loop closes the return, with outcome, item and reason as properties.

The Loop portal is hosted outside your site, so the PostHog snippet never sees the return happen, and installing it on the portal would mostly produce anonymous visits. The server event is the record. Set the event UUID from the Loop return ID and status, so a retried webhook or replayed batch does not create a second return in your funnels.

Done that way, you can build a funnel from product view to purchase to return outcome and break it down by variant, campaign or page version, which neither Loop's own reports nor an ad platform can do. Treat it as analysis, not revenue reporting: PostHog is not where net revenue should be reconciled, your store and finance data are.

Loop → PostHog · what breaks

Why this join usually fails — Loop → PostHog

  1. 01

    The distinct_id never reaches Loop

    Returns are initiated weeks after the order, in a Loop-hosted portal, with no session from the original purchase.

  2. 02

    Every return treated as a full refund

    It understates revenue on exchanges, which is exactly the outcome Loop is designed to produce. A store with a high exchange rate reports itself as performing far worse 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.

Loop → PostHog · the fix

What working looks like — Loop → PostHog

  • The distinct_id on every return

  • Conversions arriving in PostHog

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

  • Reconciled against the source

    Loop Returns's own records are the reference, not either dashboard.

Loop → PostHog · architecture

How Loop and PostHog actually connect

  1. 1

    Loop Returns holds the truth

    An exchange keeps the revenue and costs you shipping. A refund reverses it entirely. Store credit sits in between. Treating all three as one reversal loses the distinction Loop exists to create.

  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 Loop return.

  4. 4

    The event source decides reliability

    Send orders, then adjust: refunds reverse fully, exchanges reverse only the shipping cost, store credit reverses to the credit's value.

  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.

Loop → PostHog · normal or broken

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

Normal, not a fault

  • The distinct_id present on the return

    Visible on the record itself in Loop Returns, not merely captured somewhere on the site.

  • Sent from the store order record, adjusted by Loop outcomes

  • 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

    PostHog's count and Loop Returns's records agree within a few percent over a closed window.

Actually broken

  • The distinct_id missing on most records

    Returns are initiated weeks after the order, in a Loop-hosted portal, with no session from the original purchase.

  • Sent from the browser

    It understates revenue on exchanges, which is exactly the outcome Loop is designed to produce. A store with a high exchange rate reports itself as performing far worse 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

    The dashboard shows a number and no one has compared it to Loop Returns.

Loop → PostHog · diagnose

Diagnostic order — Loop → PostHog

  1. 01

    Count returns carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Split returns by outcome — refund, exchange, store credit

    The mix differs by campaign and by product, and it changes the net revenue figure materially.

  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.

Loop → PostHog · prove

How it gets proven — Loop → PostHog

Against Loop Returns's own records, not against either platform's dashboard.

Source of truth

Store orders net of returns, with exchanges and refunds distinguished.

  • The distinct_id confirmed present on a live return.
  • Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
  • Net revenue reconciled after the return window with the three outcomes adjusted separately.

Loop → PostHog · free audit

What we check in the free audit

  • Count returns carrying the distinct_id
  • Follow one real conversion end to end
  • Split returns by outcome — refund, exchange, store credit
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

Store orders net of returns, with exchanges and refunds distinguished.

Get my free conversion tracking audit

Free30 minutesNo obligation

Loop → PostHog · when not to buy

When you don't need this — Loop → PostHog

  • If PostHog already reports conversions that reconcile against Loop Returns's records within a few percent, this join is working and there is nothing to buy.
  • Measure identifier coverage yourself first — pull your last hundred returns and count how many carry the distinct_id.
  • If you only issue refunds, a simple full reversal is correct and this distinction adds nothing.
  • 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.

Loop → PostHog · what we deliver

What gets built — Loop → PostHog

  • Identifier capture into Loop

    Join on the order identifier. There is no identifier to capture here — the work is carrying the order's through and reversing correctly.

  • Event source: the store order record, adjusted by Loop outcomes

    Send orders, then adjust: refunds reverse fully, exchanges reverse only the shipping cost, store credit reverses to the credit's value.

  • 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

    This is the whole integration. Three outcomes, three different adjustments.

Written guarantee

95%+ tracking accuracy

Measured against Store orders net of returns, with exchanges and refunds distinguished.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Loop → PostHog questions, answered

Capture a server-side event when Loop closes a return, using the distinct_id stored on the original order and the return ID as the event UUID. Include outcome and reason as properties.

Free · 30 min

Get Loop and PostHog joined properly

Free30 minutesNo obligation