Skip to main content
Affirm → MatomoIntegration guide

Connecting Affirm to Matomo

Affirm is longer-term financed BNPL, typically on higher-ticket items, which adds a credit decision between the checkout and the sale. Matomo can be self-hosted with no third party in the chain, which makes it the one analytics destination where the data genuinely never leaves infrastructure you control. The join between them succeeds or fails on one thing: whether the first-party visitor ID reaches the Affirm charge before the conversion happens, because Matomo can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Affirm to Matomo: backdating captured orders to the right visit

Send the Affirm purchase as a Matomo ecommerce order through the HTTP Tracking API with the visitor ID stored at checkout, the Affirm charge ID as order ID and the captured amount. Late captures need authenticated backdating and re-archived reports. Add Affirm's domains to excluded referrers so returning shoppers stay with the campaign visit.

Matomo's ecommerce order is the right home for an Affirm purchase, sent server-side through the HTTP Tracking API with the visitor ID stored on the order at checkout, the Affirm charge ID as the order ID and the captured amount as revenue. The order ID matters doubly here: without it a confirmation page reload records a second order, and so would a server hit sent at both authorization and capture.

Capture timing is the complication particular to Affirm. If you capture at shipment, the order reaches Matomo days after the visit. Matomo can accept a backdated hit, but backdating beyond a short window needs an authenticated request, and reports for days already processed must be invalidated and re-archived to include it. Check both on your instance; otherwise financed orders show up on the day they shipped, cut off from the visit that produced them.

Then the referrer. Shoppers who return from Affirm's site arrive with Affirm as the referrer, and Matomo can start a new visit credited to a website referral. Add Affirm's domains to excluded referrers so the order stays with the campaign visit, then place a test Affirm order from a tagged URL and confirm which channel it lands in.

Affirm → Matomo · what breaks

Why this join usually fails — Affirm → Matomo

  1. 01

    The first-party visitor 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

    Owning the pipeline means owning the outage

    The advantage is that nothing blocks it. The cost is that when the tracking database fills or falls behind on a weekend, the data is gone and no vendor is paging anyone. Hosted tools fail more visibly.

  4. 04

    Nothing reconciles afterwards

    Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.

Affirm → Matomo · the fix

What working looks like — Affirm → Matomo

  • The first-party visitor ID on every order

  • Conversions arriving in Matomo

    The event lands in your own database and is queryable directly, including the raw log, which most analytics products do not expose.

  • Reconciled against the source

Affirm → Matomo · architecture

How Affirm and Matomo 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

    Matomo needs a click to match

    The site ID, the visitor identifier and the event or ecommerce order. Self-hosted instances additionally need the tracker endpoint reachable and the database keeping up, which hosted tools do not fail at.

  3. 3

    The identifier is the bridge

    The first-party visitor 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

    Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.

Affirm → Matomo · normal or broken

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

Normal, not a fault

  • The first-party visitor ID present on the order

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

  • Deduplicated correctly

    Matomo deduplicates ecommerce orders on order ID. Without one, a refreshed confirmation page records a second order.

  • Reconciles with the source

Actually broken

  • The first-party visitor 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 is that nothing blocks it. The cost is that when the tracking database fills or falls behind on a weekend, the data is gone and no vendor is paging anyone. Hosted tools fail more visibly.

  • Nobody has reconciled it

Affirm → Matomo · diagnose

Diagnostic order — Affirm → Matomo

  1. 01

    Count orders carrying the first-party visitor 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 tracker reachability and database lag before debugging any tag

    On self-hosted analytics the answer is infrastructure more often than instrumentation.

  5. 05

    Read the match rate, not the success message

    Matomo exposes raw visit logs, so you can inspect the actual hit rather than an aggregate. Check the log, and check ingestion lag alongside it.

Affirm → Matomo · prove

How it gets proven — Affirm → Matomo

Source of truth

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

  • The first-party visitor ID confirmed present on a live order.
  • Orders reconciled against the Matomo ecommerce log with order-ID deduplication verified.
  • An approved Affirm order confirmed to report and a declined one confirmed not to.

Affirm → Matomo · free audit

What we check in the free audit

  • Count orders carrying the first-party visitor ID
  • Follow one real conversion end to end
  • Compare Affirm checkouts started, approved and captured
  • Check tracker reachability and database lag before debugging any tag
  • 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 → Matomo · when not to buy

When you don't need this — Affirm → Matomo

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the first-party visitor 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 privacy or ownership requirement and no team to run it, a hosted product removes the only real cost of this one.

Affirm → Matomo · what we deliver

What gets built — Affirm → Matomo

  • 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 Matomo

    The Matomo HTTP Tracking API, posted server-side from your order system.

  • 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 → Matomo questions, answered

Shoppers returning from Affirm's approval flow carry Affirm as the referrer. Add Affirm's domains to Matomo's excluded referrers and send the order server-side with the stored visitor ID.

Free · 30 min

Get Affirm and Matomo joined properly

Free30 minutesNo obligation