Skip to main content
Stripe → MatomoIntegration guide

Connecting Stripe to Matomo

Stripe knows exactly what was paid, by whom, and when — down to the cent, including the refund three weeks later. 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 Stripe Customer or PaymentIntent 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

Stripe orders in self-hosted Matomo through the tracking API

Read Matomo's visitor ID before redirecting to Stripe, write it into Checkout Session metadata, and post an ecommerce order from the webhook with that visitor ID, the PaymentIntent ID as order ID, revenue and line items, using a server-only token_auth. Exclude Stripe's checkout domain as a referrer, queue and retry webhook payloads, and record refunds as separate events.

A Matomo ecommerce order needs the visitor ID of the session that browsed, and checkout.stripe.com is outside your domain, so the JavaScript tracker loses the visit at the redirect. Read the visitor ID from the tracker before sending the customer to Stripe, write it into the Checkout Session metadata, and on the webhook post an ecommerce order to your Matomo tracking endpoint with that visitor ID, the PaymentIntent ID as order ID, the revenue, and line items retrieved from the session.

Server-side hits that set a visitor ID or backdate the timestamp need a token_auth, and without it Matomo ignores those parameters; check your version's rules and keep the token on the server only. Also add Stripe's checkout domain to Matomo's excluded referrers, or the return from Stripe starts a new referral visit and checkout.stripe.com shows up as the source of your sales.

The self-hosted risk is quiet: if your tracker endpoint is down when Stripe fires, the order never lands. Queue webhook payloads and retry, relying on the order ID so a replayed order is rejected instead of counted twice. Matomo ecommerce reports have no native refund reversal, so record charge.refunded as a separate event and reconcile net revenue against Stripe.

Stripe → Matomo · what breaks

Why this join usually fails — Stripe → Matomo

  1. 01

    The first-party visitor ID never reaches Stripe

    Stripe Checkout runs on checkout.stripe.com, a different origin from your site, so nothing you set in a first-party cookie travels with the customer. The identifier has to be put into PaymentIntent metadata (or the Checkout Session's metadata) at the moment you create the session, server-side. If you create sessions from a price link or a Buy Button, there is no server step and no metadata — that setup cannot be joined to advertising at all without changing how sessions are created.

  2. 02

    Checkout is on Stripe's domain, so the browser loses the thread

    The customer leaves your site, pays somewhere else, and comes back to a thank-you page. Anything relying on browser continuity across that hop is unreliable, and on Safari it is worse than unreliable.

  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.

Stripe → Matomo · the fix

What working looks like — Stripe → Matomo

  • The first-party visitor ID on every payment

  • 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

Stripe → Matomo · architecture

How Stripe and Matomo actually connect

  1. 1

    Stripe holds the truth

    Every succeeded PaymentIntent is a real conversion with a real amount and currency. No sampling, no modeling, no consent gate. This is the number the business actually banked, which is why it is the reference rather than anything either ad platform reports.

  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 Stripe Customer or PaymentIntent.

  4. 4

    The event source decides reliability

    Subscribe to payment_intent.succeeded (or checkout.session.completed) and send from your server when Stripe fires it. Reading a payment from the thank-you page instead means every customer who closes the tab on the redirect is a conversion you never counted, and Stripe redirects after taking money, not before.

  5. 5

    Deduplication at the destination

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

Stripe → Matomo · normal or broken

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

Normal, not a fault

  • The first-party visitor ID present on the payment

  • Sent from the Stripe webhook

  • 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

    Stripe Checkout runs on checkout.stripe.com, a different origin from your site, so nothing you set in a first-party cookie travels with the customer. The identifier has to be put into PaymentIntent metadata (or the Checkout Session's metadata) at the moment you create the session, server-side. If you create sessions from a price link or a Buy Button, there is no server step and no metadata — that setup cannot be joined to advertising at all without changing how sessions are created.

  • Sent from the browser

    The customer leaves your site, pays somewhere else, and comes back to a thank-you page. Anything relying on browser continuity across that hop is unreliable, and on Safari it is worse than unreliable.

  • 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

Stripe → Matomo · diagnose

Diagnostic order — Stripe → Matomo

  1. 01

    Count payments carrying the first-party visitor ID

  2. 02

    Follow one real conversion end to end

  3. 03

    Open one succeeded PaymentIntent in the Stripe dashboard

    Look at its Metadata section. If the identifier is not there, nothing downstream can fix it — the join is broken at the source and every other check is wasted effort.

  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.

Stripe → Matomo · prove

How it gets proven — Stripe → Matomo

Source of truth

The Stripe dashboard — Payments, filtered to succeeded, for the same window.

  • The first-party visitor ID confirmed present on a live payment.
  • Orders reconciled against the Matomo ecommerce log with order-ID deduplication verified.
  • A refunded payment confirmed to reverse, not just the sale confirmed to send.

Stripe → Matomo · free audit

What we check in the free audit

  • Count payments carrying the first-party visitor ID
  • Follow one real conversion end to end
  • Open one succeeded PaymentIntent in the Stripe dashboard
  • Check tracker reachability and database lag before debugging any tag
  • Read the match rate, not the success message

Checked against

The Stripe dashboard — Payments, filtered to succeeded, for the same window.

Get my free conversion tracking audit

Free30 minutesNo obligation

Stripe → Matomo · when not to buy

When you don't need this — Stripe → Matomo

  • Measure identifier coverage yourself first — pull your last hundred payments and count how many carry the first-party visitor ID.
  • If you take payment through a hosted Payment Link or Buy Button and have no server creating sessions, this needs a development change on your side before any tracking work is worth commissioning. Worth knowing before you pay for tracking.
  • 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.

Stripe → Matomo · what we deliver

What gets built — Stripe → Matomo

  • Identifier capture into Stripe

    Read the click identifier from the landing page, persist it in a first-party cookie, and pass it into the create-session call as metadata. Stripe carries metadata onto the resulting PaymentIntent and Charge, so it survives to the webhook and to any later refund.

  • Event source: the Stripe webhook

    Subscribe to payment_intent.succeeded (or checkout.session.completed) and send from your server when Stripe fires it. Reading a payment from the thank-you page instead means every customer who closes the tab on the redirect is a conversion you never counted, and Stripe redirects after taking money, not before.

  • Dispatch to Matomo

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

  • Reversals where they exist

    Stripe fires charge.refunded and charge.dispute.created. Both carry the original metadata, so a refund can be sent as a negative or a retraction wherever the destination supports it. Most setups never wire this and quietly overstate revenue by the refund rate.

Written guarantee

95%+ tracking accuracy

Measured against The Stripe dashboard — Payments, filtered to succeeded, for the same window.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Stripe → Matomo questions, answered

The return from Stripe starts a new referral. Add Stripe's checkout domain to excluded referrers and send the order server-side against the original visitor ID.

Free · 30 min

Get Stripe and Matomo joined properly

Free30 minutesNo obligation