Skip to main content
Braintree → SegmentIntegration guide

Connecting Braintree to Segment

Braintree is a payment gateway rather than a storefront, so it sits underneath whatever is taking the order and holds the transaction itself. 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 Braintree transaction 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

Braintree into Segment: one Order Completed per settled transaction

Write your user ID, plus anonymousId for guests, into Braintree custom fields at sale, then send Order Completed from the settlement handler with order ID, total, currency, stored click IDs and consent state. Derive the messageId from the Braintree transaction ID. Send Order Refunded keyed on the original order, looked up from the refund's credit transaction.

A Braintree merchant usually adds Segment to fan payments out to ad platforms, analytics and a warehouse from one place. The value is only there if the server-side Order Completed carries the same userId your front end identifies with. Braintree has no idea what that is unless your server puts it on the transaction, so write your application user ID, plus the anonymousId for guest checkouts, into Braintree custom fields when the sale is created.

Send Order Completed from your settlement handler, not the confirmation page, with the order ID, total, currency, and the click IDs stored on the transaction as properties so the downstream ad destinations can use them. Use a messageId derived from the Braintree transaction ID, so a webhook retry does not reach every destination twice. Pass the consent state captured at checkout as well; Segment will not invent it, and every ad destination downstream needs it.

Refunds deserve their own Order Refunded call keyed on the original order. Braintree records a refund as a new credit transaction that references the sale, so the handler has to look up the original order ID before calling Segment. Check whether a Braintree source exists in your Segment catalog; if not, the webhook handler calling Segment's server library is the normal path, and it keeps the identity logic in your code.

Braintree → Segment · what breaks

Why this join usually fails — Braintree → Segment

  1. 01

    The userId and anonymousId never reaches Braintree

    Braintree is a gateway, so it sees the payment and not the marketing. The identifier has to be attached at the point your application creates the transaction, through custom fields, or it never enters Braintree at all.

  2. 02

    A gateway that knows nothing about marketing

    Braintree sees a payment. Whether it can be tied to a click depends entirely on whether your own application attached the identifier when creating the transaction, and most do not.

  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.

Braintree → Segment · the fix

What working looks like — Braintree → Segment

  • The userId and anonymousId on every transaction

  • Conversions arriving in Segment

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

  • Reconciled against the source

Braintree → Segment · architecture

How Braintree and Segment actually connect

  1. 1

    Braintree holds the truth

    Settled and authorised are different states. Authorisation reserves the funds; settlement is money moving, and reporting on the wrong one produces a persistent gap against your bank.

  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 Braintree transaction.

  4. 4

    The event source decides reliability

    Fire on settlement rather than authorisation, and note that Braintree's PayPal and wallet flows redirect the buyer away — so the confirmation page is not a reliable trigger.

  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.

Braintree → Segment · normal or broken

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

Normal, not a fault

  • The userId and anonymousId present on the transaction

  • Sent from the Braintree transaction settlement 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

    Braintree is a gateway, so it sees the payment and not the marketing. The identifier has to be attached at the point your application creates the transaction, through custom fields, or it never enters Braintree at all.

  • Sent from the browser

    Braintree sees a payment. Whether it can be tied to a click depends entirely on whether your own application attached the identifier when creating the transaction, and most do not.

  • 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

Braintree → Segment · diagnose

Diagnostic order — Braintree → Segment

  1. 01

    Count transactions carrying the userId and anonymousId

  2. 02

    Follow one real conversion end to end

  3. 03

    Open a settled transaction and check its custom fields

    If the identifier is not there, your application never attached it and nothing downstream can recover it.

  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.

Braintree → Segment · prove

How it gets proven — Braintree → Segment

Source of truth

Braintree's transaction records, filtered to settled, for the same window.

  • The userId and anonymousId confirmed present on a live transaction.
  • An anonymous session confirmed aliased to a known user, with the event visible in at least one downstream destination.
  • A PayPal-funded transaction confirmed to report even though the buyer was redirected away.

Braintree → Segment · free audit

What we check in the free audit

  • Count transactions carrying the userId and anonymousId
  • Follow one real conversion end to end
  • Open a settled transaction and check its custom fields
  • Check identity resolution before checking anything downstream
  • Read the match rate, not the success message

Checked against

Braintree's transaction records, filtered to settled, for the same window.

Get my free conversion tracking audit

Free30 minutesNo obligation

Braintree → Segment · when not to buy

When you don't need this — Braintree → Segment

  • Measure identifier coverage yourself first — pull your last hundred transactions and count how many carry the userId and anonymousId.
  • If your platform already reports orders accurately and Braintree is purely the funding rail, work at the order layer instead — it is closer to the customer.
  • 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.

Braintree → Segment · what we deliver

What gets built — Braintree → Segment

  • Identifier capture into Braintree

    Pass the click identifier into the transaction's custom fields when your server creates the charge. Braintree preserves them and they survive to the webhook and to any later refund.

  • Event source: the Braintree transaction settlement webhook

    Fire on settlement rather than authorisation, and note that Braintree's PayPal and wallet flows redirect the buyer away — so the confirmation page is not a reliable trigger.

  • 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

    Braintree exposes refunds and disputes, both carrying the original custom fields, so reversals are straightforward.

Written guarantee

95%+ tracking accuracy

Measured against Braintree's transaction records, filtered to settled, for the same window.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Braintree → Segment questions, answered

Your application's user ID, written into a Braintree custom field at transaction creation. The Braintree customer ID is only useful as a trait, not as the identity.

Free · 30 min

Get Braintree and Segment joined properly

Free30 minutesNo obligation