Skip to main content
ReferralCandy → PostHogIntegration guide

Connecting ReferralCandy to PostHog

ReferralCandy serves smaller stores where the referral programme is often the second-largest acquisition channel and is almost never measured against paid media properly. 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 ReferralCandy referral 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

ReferralCandy in PostHog: are referred customers worth more?

Use the store customer ID as the PostHog distinct_id and set an acquisition source person property once at first order, referral when the cookie or friend's coupon is present. Send orders server-side with order ID, discounted revenue and an event UUID, and record reward issued and reclaimed on the referrer. Compare cohorts on repeat orders at 90 and 180 days.

The question PostHog can answer for a referral program is lifetime value: do referred customers reorder more than customers from paid channels, net of the reward and the friend's discount? That needs the acquisition source pinned to the person at first purchase and every later order on the same distinct_id.

Use the store customer ID as the distinct_id, aliased from the anonymous ID at checkout. On the first order, set a person property for acquisition source once, using PostHog's set-once behavior so a later paid click cannot overwrite it: referral when the referral cookie or friend's coupon is present, otherwise the paid source. Send orders server-side with order ID, revenue after discount, and an event UUID so a retried batch does not duplicate. Record reward issued and reclaimed as events on the referrer.

Then build cohorts by acquisition source and compare repeat orders and net revenue at 90 and 180 days. Browser events help with the top of the referral funnel: share-link clicks on the post-purchase page and referral landing visits. Check whether those pages run your PostHog script; ReferralCandy pages hosted on its own domain will not. The order-side data is where the answer comes from.

ReferralCandy → PostHog · what breaks

Why this join usually fails — ReferralCandy → PostHog

  1. 01

    The distinct_id never reaches ReferralCandy

    Referral links land with their own parameters on a store that may already hold a paid identifier.

  2. 02

    Referral and paid competing for the same orders

    Without a precedence rule the credit goes to whichever parameter was written last, which means your reported channel mix is an accident of browsing order.

  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.

ReferralCandy → PostHog · the fix

What working looks like — ReferralCandy → PostHog

  • The distinct_id on every referral

  • Conversions arriving in PostHog

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

  • Reconciled against the source

ReferralCandy → PostHog · architecture

How ReferralCandy and PostHog actually connect

  1. 1

    ReferralCandy holds the truth

    At small-store scale the referral programme can rival paid acquisition in volume. Pooling them means neither channel's true cost per acquisition is knowable.

  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 ReferralCandy referral.

  4. 4

    The event source decides reliability

    Send orders net of rewards, with referral orders marked and excluded from paid conversion imports.

  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.

ReferralCandy → PostHog · normal or broken

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

Normal, not a fault

  • The distinct_id present on the referral

  • Sent from your order feed with referral attribution

  • 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

    Referral links land with their own parameters on a store that may already hold a paid identifier.

  • Sent from the browser

    Without a precedence rule the credit goes to whichever parameter was written last, which means your reported channel mix is an accident of browsing order.

  • 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

ReferralCandy → PostHog · diagnose

Diagnostic order — ReferralCandy → PostHog

  1. 01

    Count referrals carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Count orders carrying both a referral and a paid parameter

    It is usually a meaningful share, and every one of them is currently credited by luck.

  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.

ReferralCandy → PostHog · prove

How it gets proven — ReferralCandy → PostHog

Source of truth

Store orders flagged by referral, net of both rewards.

  • The distinct_id confirmed present on a live referral.
  • Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
  • Non-referral orders reconciled against imported conversions, with referral volume and reward cost stated.

ReferralCandy → PostHog · free audit

What we check in the free audit

  • Count referrals carrying the distinct_id
  • Follow one real conversion end to end
  • Count orders carrying both a referral and a paid parameter
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

Store orders flagged by referral, net of both rewards.

Get my free conversion tracking audit

Free30 minutesNo obligation

ReferralCandy → PostHog · when not to buy

When you don't need this — ReferralCandy → PostHog

  • Measure identifier coverage yourself first — pull your last hundred referrals and count how many carry the distinct_id.
  • No referral programme, no conflict.
  • 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.

ReferralCandy → PostHog · what we deliver

What gets built — ReferralCandy → PostHog

  • Identifier capture into ReferralCandy

    Set precedence explicitly and record both identifiers on the order.

  • Event source: your order feed with referral attribution

    Send orders net of rewards, with referral orders marked and excluded from paid conversion imports.

  • 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 reverse and reclaim rewards.

Written guarantee

95%+ tracking accuracy

Measured against Store orders flagged by referral, net of both rewards.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

ReferralCandy → PostHog questions, answered

Set an acquisition source person property once at first purchase, send all orders server-side on the same distinct_id, and compare cohorts on repeat revenue.

Free · 30 min

Get ReferralCandy and PostHog joined properly

Free30 minutesNo obligation