Skip to main content
Friendbuy → PostHogIntegration guide

Connecting Friendbuy to PostHog

Friendbuy runs customer-to-customer referral, which means the acquisition was produced by an existing customer and paid for with a reward on both sides. 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 Friendbuy 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

Friendbuy's referral funnel in PostHog, on one person

When a friend lands from a Friendbuy link, record the referral parameters on the landing event and as set-once person properties, then identify at signup or checkout to merge the visit. Send purchases server-side with the same distinct_id and a UUID per order. Give advocates a person property, and split shared-device persons by identifying with the friend's user ID.

PostHog is where Friendbuy's funnel can be seen end to end on one person: the advocate sees the share prompt, shares, the friend lands, claims the offer and buys. Friendbuy reports its own slice of that. PostHog can join it to product and purchase behavior afterwards, which answers the question that justifies the reward budget: do referred customers retain or repurchase better than paid ones?

The join: when a friend lands from a referral link, record the referral parameters on the landing event and as set-once person properties, so a later visit through an ad cannot overwrite the first acquisition source. At signup or checkout, identify the user so the anonymous referral visit merges into the purchaser. Server-side, send the purchase from your order system with the same distinct_id and a UUID per order, so a retried webhook does not create a second purchase.

Advocates need a person property, not a stream of reward events that look like activity. The failure specific to this pair is the shared device: a couple referring each other on the household laptop, so the friend's referral visit attaches to the advocate's distinct_id. Look for persons flagged as both advocate and referred friend; that is almost always this, and identifying with the friend's own user ID at signup splits them.

Friendbuy → PostHog · what breaks

Why this join usually fails — Friendbuy → PostHog

  1. 01

    The distinct_id never reaches Friendbuy

    Referral links route through Friendbuy and land on your store with their own parameters, potentially overwriting a stored paid identifier.

  2. 02

    Word of mouth billed to the ad account

    The better your referral programme performs, the worse your paid reporting gets — a genuinely perverse outcome caused entirely by last-write-wins identifier storage that nobody consciously chose.

  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.

Friendbuy → PostHog · the fix

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

Friendbuy → PostHog · architecture

How Friendbuy and PostHog actually connect

  1. 1

    Friendbuy holds the truth

    A double-sided referral costs you two discounts to acquire one customer. That is a real and known acquisition cost, and it sits nowhere near the ad account that will otherwise claim the sale.

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

  4. 4

    The event source decides reliability

    Send orders net of both referral rewards, with referral-sourced orders marked and held out of 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.

Friendbuy → PostHog · normal or broken

Working vs. broken, side by side — Friendbuy → 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 route through Friendbuy and land on your store with their own parameters, potentially overwriting a stored paid identifier.

  • Sent from the browser

    The better your referral programme performs, the worse your paid reporting gets — a genuinely perverse outcome caused entirely by last-write-wins identifier storage that nobody consciously chose.

  • 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

Friendbuy → PostHog · diagnose

Diagnostic order — Friendbuy → PostHog

  1. 01

    Count referrals carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Check precedence between referral and paid parameters

    Whichever wins decides who gets credit, and almost nobody has decided it deliberately.

  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.

Friendbuy → PostHog · prove

How it gets proven — Friendbuy → PostHog

Source of truth

Orders flagged by whether a referral produced them, with both reward costs recorded.

  • 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 reported separately.

Friendbuy → PostHog · free audit

What we check in the free audit

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

Checked against

Orders flagged by whether a referral produced them, with both reward costs recorded.

Get my free conversion tracking audit

Free30 minutesNo obligation

Friendbuy → PostHog · when not to buy

When you don't need this — Friendbuy → PostHog

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

Friendbuy → PostHog · what we deliver

What gets built — Friendbuy → PostHog

  • Identifier capture into Friendbuy

    Apply an explicit precedence rule between referral and paid parameters and record both on the order.

  • Event source: your order feed with referral attribution

    Send orders net of both referral rewards, with referral-sourced orders marked and held out of 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 should reclaim rewards.

Written guarantee

95%+ tracking accuracy

Measured against Orders flagged by whether a referral produced them, with both reward costs recorded.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Friendbuy → PostHog questions, answered

Store the first acquisition source as a set-once person property at landing, then break retention and revenue insights down by it.

Free · 30 min

Get Friendbuy and PostHog joined properly

Free30 minutesNo obligation