Skip to main content
Stripe → SegmentIntegration guide

Connecting Stripe to Segment

Stripe knows exactly what was paid, by whom, and when — down to the cent, including the refund three weeks later. Segment is a customer data platform rather than an ad network, so sending to it is not about matching a conversion — it is about putting one clean event where every other destination can read it. The join between them succeeds or fails on one thing: whether the userId and anonymousId reaches the Stripe Customer or PaymentIntent before the conversion happens, because Segment can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Stripe into Segment: a server-side Order Completed with a real userId

Send Order Completed to Segment from the Stripe webhook, with your userId from Customer metadata and the anonymousId, click IDs and consent from Checkout Session metadata. Use the PaymentIntent or invoice ID as order_id, revenue converted from cents, line-item products, and messageId from the Stripe event ID. Send Order Refunded on refunds and switch off browser Order Completed.

Segment wants one Order Completed event every destination trusts, and Stripe is the best place to source it because the webhook fires on money actually taken. The identity work is getting Segment's IDs onto Stripe objects: your userId in Stripe Customer metadata, and the browser's anonymousId plus captured click IDs in Checkout Session metadata at creation, so the webhook can send a track call that stitches to earlier page views.

Build the event from checkout.session.completed or invoice.paid, with order_id as the PaymentIntent or invoice ID, revenue converted from cents, currency, and products from the line items. Set messageId from the Stripe event ID, because Stripe retries webhooks and Segment will fan a retry out to every destination. Pass consent state from session metadata too, so destinations that require consent receive only conversions from visitors who gave it.

Check what Segment's Stripe source does before relying on it; as we understand it, it syncs Stripe objects to a warehouse rather than emitting events to ad destinations, so it does not replace the server-side Order Completed. Refunds should arrive as Order Refunded with the original order_id. The common breakage is a second, browser-side Order Completed from the thank-you page creating a duplicate with a different messageId; switch it off once the server event is live.

Stripe → Segment · what breaks

Why this join usually fails — Stripe → Segment

  1. 01

    The userId and anonymousId 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

    One bad event multiplied across every destination

    Segment's value is fan-out, which is also its risk. An inconsistent identity or a duplicated event does not break one report — it breaks every connected tool simultaneously, and tracing it back is harder than debugging a direct integration.

  4. 04

    Nothing reconciles afterwards

    Segment's debugger shows events arriving and which destinations accepted them. Arriving is not the test — check a destination you care about and confirm the event landed there with the identity intact, then reconcile against your own records.

Stripe → Segment · the fix

What working looks like — Stripe → Segment

  • The userId and anonymousId on every payment

  • Conversions arriving in Segment

    Events land in Segment and forward to every connected destination, warehouse included, on one shared definition.

  • Reconciled against the source

Stripe → Segment · architecture

How Stripe and Segment 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

    Segment needs a click to match

    Segment needs a consistent identity model — the same userId everywhere, an alias when an anonymous visitor becomes known, and event names that follow one spec. Feeding it inconsistent identities pushes the mess to every connected destination at once.

  3. 3

    The identifier is the bridge

    The userId and anonymousId, 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

    Segment deduplicates on messageId within a window. Because it fans out to many destinations, a duplicate here becomes a duplicate everywhere, which makes idempotent messageIds more important than in any single-destination integration.

Stripe → Segment · normal or broken

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

Normal, not a fault

  • The userId and anonymousId present on the payment

  • Sent from the Stripe webhook

  • Deduplicated correctly

    Segment deduplicates on messageId within a window. Because it fans out to many destinations, a duplicate here becomes a duplicate everywhere, which makes idempotent messageIds more important than in any single-destination integration.

  • Reconciles with the source

Actually broken

  • The userId and anonymousId 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

    Segment's value is fan-out, which is also its risk. An inconsistent identity or a duplicated event does not break one report — it breaks every connected tool simultaneously, and tracing it back is harder than debugging a direct integration.

  • Nobody has reconciled it

Stripe → Segment · diagnose

Diagnostic order — Stripe → Segment

  1. 01

    Count payments carrying the userId and anonymousId

  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 identity resolution before checking anything downstream

    If anonymousId is never aliased to userId, every destination sees two people where there is one, and no downstream fix helps.

  5. 05

    Read the match rate, not the success message

    Segment's debugger shows events arriving and which destinations accepted them. Arriving is not the test — check a destination you care about and confirm the event landed there with the identity intact, then reconcile against your own records.

Stripe → Segment · prove

How it gets proven — Stripe → Segment

Source of truth

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

  • The userId and anonymousId confirmed present on a live payment.
  • An anonymous session confirmed aliased to a known user, with the event visible in at least one downstream destination.
  • A refunded payment confirmed to reverse, not just the sale confirmed to send.

Stripe → Segment · free audit

What we check in the free audit

  • Count payments carrying the userId and anonymousId
  • Follow one real conversion end to end
  • Open one succeeded PaymentIntent in the Stripe dashboard
  • Check identity resolution before checking anything downstream
  • 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 → Segment · when not to buy

When you don't need this — Stripe → Segment

  • Measure identifier coverage yourself first — pull your last hundred payments and count how many carry the userId and anonymousId.
  • 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 send to one or two destinations, Segment is infrastructure you do not need — direct integrations are simpler and cheaper. It earns its place at genuine fan-out.

Stripe → Segment · what we deliver

What gets built — Stripe → Segment

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

    Server-side track and identify calls with a stable messageId, consistent userId, and the click identifier carried as a trait or property.

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

Check its current documentation; it has synced Stripe objects to warehouses rather than emitting track events. Send Order Completed yourself from the Stripe webhook.

Free · 30 min

Get Stripe and Segment joined properly

Free30 minutesNo obligation