Skip to main content
Affirm → PostHogIntegration guide

Connecting Affirm to PostHog

Affirm is longer-term financed BNPL, typically on higher-ticket items, which adds a credit decision between the checkout and the sale. 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 Affirm charge 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

Affirm to PostHog: the approval step as a funnel you can see

Track checkout started with Affirm, return from Affirm, and order captured, sending the capture from your server with the distinct_id stored at checkout and a UUID per event. That fixes returns that land on a new anonymous ID. Identify on order email if policy allows, and keep any credit outcome as an event property, never a person property.

PostHog is where the Affirm decline rate becomes a funnel you can inspect. Track checkout started with Affirm selected, the shopper returning from Affirm, and the order captured, the last one sent from your server through the capture API with the distinct_id stored on the order when checkout began. The drop between started and captured is the cost of the payment method, and broken down by product or traffic source it shows where financing actually closes sales.

Two identity hazards come with Affirm. The shopper leaves your site for Affirm and can come back in a different browser context, especially on mobile, so a client-side order event can land on a new anonymous distinct_id and break the funnel; the server-side event with the stored ID fixes it. And if you identify users only at account creation, guest Affirm buyers never merge with their earlier sessions, so identify on the order email at checkout if your privacy policy allows.

Keep the credit outcome as an event property at most, never a person property. A person property saying an Affirm application was declined persists, is visible to everyone with PostHog access, and on PostHog Cloud leaves your infrastructure. Supply a UUID per server event so a retried capture webhook does not duplicate a high-value order in revenue insights.

Affirm → PostHog · what breaks

Why this join usually fails — Affirm → PostHog

  1. 01

    The distinct_id never reaches Affirm

    The shopper leaves for Affirm's flow, is assessed, and returns only if approved. Both the redirect and the decline create paths where nothing fires on your site.

  2. 02

    A credit decision inside the checkout

    Declines are real volume that reached checkout and produced nothing. Counting checkout starts rather than captured charges overstates performance by the decline rate.

  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.

Affirm → PostHog · the fix

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

Affirm → PostHog · architecture

How Affirm and PostHog actually connect

  1. 1

    Affirm holds the truth

    Affirm runs a real credit decision, so a shopper who reaches checkout may be declined. The order only exists if the financing was approved and captured.

  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 Affirm charge.

  4. 4

    The event source decides reliability

    Fire on capture after approval, and tag the payment method — Affirm orders skew to higher ticket values that will distort a blended average.

  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.

Affirm → PostHog · normal or broken

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

Normal, not a fault

  • The distinct_id present on the order

  • Sent from your store's order webhook, on Affirm charge capture

  • 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

    The shopper leaves for Affirm's flow, is assessed, and returns only if approved. Both the redirect and the decline create paths where nothing fires on your site.

  • Sent from the browser

    Declines are real volume that reached checkout and produced nothing. Counting checkout starts rather than captured charges overstates performance by the decline rate.

  • 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

Affirm → PostHog · diagnose

Diagnostic order — Affirm → PostHog

  1. 01

    Count orders carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Compare Affirm checkouts started, approved and captured

    The decline rate is a genuine cost of this payment method and it belongs in the report.

  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.

Affirm → PostHog · prove

How it gets proven — Affirm → PostHog

Source of truth

Your store's orders financed through Affirm, cross-checked against Affirm's settlement.

  • 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.
  • An approved Affirm order confirmed to report and a declined one confirmed not to.

Affirm → PostHog · free audit

What we check in the free audit

  • Count orders carrying the distinct_id
  • Follow one real conversion end to end
  • Compare Affirm checkouts started, approved and captured
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

Your store's orders financed through Affirm, cross-checked against Affirm's settlement.

Get my free conversion tracking audit

Free30 minutesNo obligation

Affirm → PostHog · when not to buy

When you don't need this — Affirm → PostHog

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the distinct_id.
  • If your average order value is low, Affirm is a poor fit for the payment method and the integration follows that.
  • 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.

Affirm → PostHog · what we deliver

What gets built — Affirm → PostHog

  • Identifier capture into Affirm

    Capture the identifier before checkout and store it on the order, so approved financing is attributable regardless of the return journey.

  • Event source: your store's order webhook, on Affirm charge capture

    Fire on capture after approval, and tag the payment method — Affirm orders skew to higher ticket values that will distort a blended average.

  • 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 cancelled financing both exist and should reduce the reported figure.

Written guarantee

95%+ tracking accuracy

Measured against Your store's orders financed through Affirm, cross-checked against Affirm's settlement.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Affirm → PostHog questions, answered

As a funnel: Affirm checkout started, shopper returned, and order captured from your server. Keep any decline indicator as an event property, not on the person profile.

Free · 30 min

Get Affirm and PostHog joined properly

Free30 minutesNo obligation