Skip to main content
Stripe → BigQueryIntegration guide

Connecting Stripe to BigQuery

Stripe knows exactly what was paid, by whom, and when — down to the cent, including the refund three weeks later. BigQuery has no attribution model, no deduplication rules and no opinion about your data — which makes it the only destination on this site where every number is exactly as good as the query that produced it. The join between them succeeds or fails on one thing: whether whatever join key you decide on reaches the Stripe Customer or PaymentIntent before the conversion happens, because BigQuery can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Stripe to BigQuery: charges, refunds and the metadata that joins them

Load Stripe charges, PaymentIntents, invoices, subscriptions, refunds and disputes with metadata into BigQuery, plus a table of landing captures (gclid, fbclid, UTMs, session key), joined on the session key you passed into Checkout Session metadata. Keep amounts as integers with currency, deduplicate on Stripe IDs, and report net revenue by acquisition source, counting unattributed Payment Link sales.

Stripe is the cleanest revenue record you have, and BigQuery is where it gets joined to ad data. Load charges, PaymentIntents, invoices, subscriptions, refunds and disputes with their metadata, then a separate table of landing-page captures holding gclid, fbclid, UTMs and the session key you passed into Checkout Session metadata. That metadata value is the join key. Without it, BigQuery can tell you exactly what you banked and nothing about which campaign produced it.

Check whether Stripe Data Pipeline or a Sigma export can deliver to BigQuery for your account, or whether you need a connector or your own loader built on the API and webhooks. Whichever you use, keep amounts as Stripe's integers in the smallest currency unit with currency as a column, and convert in queries; mixing cents and dollars across loads is the classic silent divergence. Use Stripe object IDs as keys and deduplicate on them after streaming inserts.

The analysis worth building is net revenue by acquisition source: succeeded charges minus refunds and lost disputes, grouped by the click ID in the first payment's metadata, over 90 days or a full year for subscriptions. It will differ from what Meta or Google reports, usually lower once refunds count, and it is the number to budget against. Payments taken through Payment Links without metadata appear unattributed; count them so the gap is visible.

Stripe → BigQuery · what breaks

Why this join usually fails — Stripe → BigQuery

  1. 01

    Whatever join key you decide on 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

    The warehouse quietly disagreeing with every platform

    This is not a bug — it is the point. Your warehouse counts orders; Google counts click-attributed conversions in its window; Meta counts differently again. When the four numbers differ, the warehouse is usually right about revenue and wrong about attribution, and knowing which question you are answering is the whole skill.

  4. 04

    Nothing reconciles afterwards

    BigQuery will not tell you anything is wrong. Verify by querying the table directly against your source system's own totals, and check for duplicate rows on the join key before trusting any aggregate.

Stripe → BigQuery · the fix

What working looks like — Stripe → BigQuery

  • Whatever join key you decide on on every payment

  • Conversions arriving in BigQuery

    The row lands in a table you own, joinable to every other table you own, with no window and no expiry.

  • Reconciled against the source

Stripe → BigQuery · architecture

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

    BigQuery needs a click to match

    BigQuery needs a schema and consistent types. The failure mode is not rejection, it is silent divergence: a column that arrives as a string in one load and an integer in the next, or a timestamp in the wrong zone, which produces answers that look plausible and are not.

  3. 3

    The identifier is the bridge

    Whatever join key you decide on, 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

    Nothing deduplicates for you. Streaming inserts are at-least-once, so a retried load can create duplicate rows, and the only protection is a deduplication step you write and actually run.

Stripe → BigQuery · normal or broken

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

Normal, not a fault

  • Whatever join key you decide on present on the payment

  • Sent from the Stripe webhook

  • Deduplicated correctly

    Nothing deduplicates for you. Streaming inserts are at-least-once, so a retried load can create duplicate rows, and the only protection is a deduplication step you write and actually run.

  • Reconciles with the source

Actually broken

  • Whatever join key you decide on 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

    This is not a bug — it is the point. Your warehouse counts orders; Google counts click-attributed conversions in its window; Meta counts differently again. When the four numbers differ, the warehouse is usually right about revenue and wrong about attribution, and knowing which question you are answering is the whole skill.

  • Nobody has reconciled it

Stripe → BigQuery · diagnose

Diagnostic order — Stripe → BigQuery

  1. 01

    Count payments carrying whatever join key you decide on

  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

    Reconcile warehouse order counts against each platform for one closed window

    The gaps localize the problem: a gap against all platforms is a collection issue, a gap against one is that platform's window or matching.

  5. 05

    Read the match rate, not the success message

    BigQuery will not tell you anything is wrong. Verify by querying the table directly against your source system's own totals, and check for duplicate rows on the join key before trusting any aggregate.

Stripe → BigQuery · prove

How it gets proven — Stripe → BigQuery

Source of truth

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

  • Whatever join key you decide on confirmed present on a live payment.
  • Warehouse order counts and revenue reconciled against the source system for a fully closed window, with duplicates checked on the join key.
  • A refunded payment confirmed to reverse, not just the sale confirmed to send.

Stripe → BigQuery · free audit

What we check in the free audit

  • Count payments carrying whatever join key you decide on
  • Follow one real conversion end to end
  • Open one succeeded PaymentIntent in the Stripe dashboard
  • Reconcile warehouse order counts against each platform for one closed window
  • 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 → BigQuery · when not to buy

When you don't need this — Stripe → BigQuery

  • Measure identifier coverage yourself first — pull your last hundred payments and count how many carry whatever join key you decide on.
  • 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 one store and one ad platform, a warehouse is infrastructure you will maintain for a reconciliation you could do in a spreadsheet.

Stripe → BigQuery · what we deliver

What gets built — Stripe → BigQuery

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

    Streaming inserts or scheduled batch loads from your order system, with the raw event retained alongside whatever you derive from it.

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

Put a click or session key into Checkout Session metadata when you create the session, load metadata with each charge, and join it to a table of landing-page captures.

Free · 30 min

Get Stripe and BigQuery joined properly

Free30 minutesNo obligation