Skip to main content
Stripe → X AdsIntegration guide

Connecting Stripe to X Ads

Stripe knows exactly what was paid, by whom, and when — down to the cent, including the refund three weeks later. X is a conversation platform where a large share of engagement is discussion rather than intent, which makes the gap between engagement metrics and conversions unusually wide. The join between them succeeds or fails on one thing: whether the twclid click identifier reaches the Stripe Customer or PaymentIntent before the conversion happens, because X Ads can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Stripe to X Ads: keeping twclid through checkout.stripe.com

Keep the twclid server-side and write it into Stripe Checkout Session metadata, then send the purchase to X from the webhook with amount converted from cents, currency, the PaymentIntent ID as conversion ID and hashed email. Give any thank-you pixel the same ID, looked up from the session. Send first subscription payments only, and check twclid coverage.

X sends traffic that is often mobile and mid-scroll, and a Stripe Checkout hop on mobile Safari is exactly where browser attribution fails. The twclid on your landing URL has to be kept server-side and written into Checkout Session metadata when the session is created; the X pixel on your thank-you page only sees customers who completed the redirect in a browser that kept its cookie.

Send the purchase from payment_intent.succeeded or checkout.session.completed with the amount converted from cents, currency, the PaymentIntent ID as conversion ID, hashed email and the twclid from metadata. If the pixel also fires a purchase on the thank-you page, give it the same ID, looked up server-side from the session ID in the success URL, so X deduplicates. X volumes are small enough that a doubled week looks like a good one, so test the pairing explicitly.

For Stripe subscriptions, send the first payment only. Founders selling SaaS or info products on X often see a launch spike in Stripe and little in X's reporting, because buyers saw organic posts rather than ads. That gap is real, not a tracking failure. Check twclid coverage in metadata on payments during campaign days; near zero means sessions are created from a Payment Link or another path that never reads the cookie.

Stripe → X Ads · what breaks

Why this join usually fails — Stripe → X Ads

  1. 01

    The twclid click identifier 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

    Engagement mistaken for intent

    A post can be quoted, argued with and shared widely by people with no interest in buying anything. Optimising toward engagement on this platform reliably finds an audience that will never convert, and the engagement numbers look excellent throughout.

  4. 04

    Nothing reconciles afterwards

    Read the delivered and matched counts in X's reporting rather than assuming a 200 response means the event was usable.

Stripe → X Ads · the fix

What working looks like — Stripe → X Ads

  • The twclid click identifier on every payment

  • Conversions arriving in X Ads

    The conversion is matched to a click or an engagement and becomes available for optimisation and reporting.

  • Reconciled against the source

Stripe → X Ads · architecture

How Stripe and X Ads 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

    X Ads needs a click to match

    An event X recognises, a conversion identifier for deduplication, hashed customer information, and the click identifier where you have it.

  3. 3

    The identifier is the bridge

    The twclid click identifier, 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

    X deduplicates browser and server events on a shared conversion ID. Send both without pairing them and every conversion counts twice — worth testing deliberately, because X volumes are often small enough that a doubling reads as a good week.

Stripe → X Ads · normal or broken

Working vs. broken, side by side — Stripe → X Ads

Normal, not a fault

  • The twclid click identifier present on the payment

  • Sent from the Stripe webhook

  • Deduplicated correctly

    X deduplicates browser and server events on a shared conversion ID. Send both without pairing them and every conversion counts twice — worth testing deliberately, because X volumes are often small enough that a doubling reads as a good week.

  • Reconciles with the source

Actually broken

  • The twclid click identifier 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

    A post can be quoted, argued with and shared widely by people with no interest in buying anything. Optimising toward engagement on this platform reliably finds an audience that will never convert, and the engagement numbers look excellent throughout.

  • Nobody has reconciled it

Stripe → X Ads · diagnose

Diagnostic order — Stripe → X Ads

  1. 01

    Count payments carrying the twclid click identifier

  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

    Compare engagement rate against conversion rate by campaign

    On X the two frequently move in opposite directions, and that divergence is the finding rather than a measurement fault.

  5. 05

    Read the match rate, not the success message

    Read the delivered and matched counts in X's reporting rather than assuming a 200 response means the event was usable.

Stripe → X Ads · prove

How it gets proven — Stripe → X Ads

Source of truth

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

  • The twclid click identifier confirmed present on a live payment.
  • Conversions reconciled per order against imported figures, with deduplication verified on a live test.
  • A refunded payment confirmed to reverse, not just the sale confirmed to send.

Stripe → X Ads · free audit

What we check in the free audit

  • Count payments carrying the twclid click identifier
  • Follow one real conversion end to end
  • Open one succeeded PaymentIntent in the Stripe dashboard
  • Compare engagement rate against conversion rate by campaign
  • 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 → X Ads · when not to buy

When you don't need this — Stripe → X Ads

  • Measure identifier coverage yourself first — pull your last hundred payments and count how many carry the twclid click identifier.
  • 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 X is a brand and community channel for you rather than a performance one, measure it that way and do not force a conversion pipeline onto it.

Stripe → X Ads · what we deliver

What gets built — Stripe → X Ads

  • 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 X Ads

    The X Conversions API, posted server-side with the click identifier and hashed customer data.

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

Store twclid in Checkout Session metadata at creation and send the purchase from your Stripe webhook with that ID and hashed email.

Free · 30 min

Get Stripe and X Ads joined properly

Free30 minutesNo obligation