Skip to main content
Refersion → BigQueryIntegration guide

Connecting Refersion to BigQuery

Refersion runs affiliate and influencer programmes on Shopify stores, which puts a commission-earning third party directly alongside your paid media on the same orders. 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 Refersion conversion 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

Refersion to BigQuery: The Query That Finds Double-Paid Orders

Load store orders with captured click identifiers and Refersion conversions with order ID, affiliate ID, commission, link-or-coupon method and status into BigQuery, joined on order ID to label orders paid, affiliate, both or neither. Append every Refersion status change with timestamps, and normalize Shopify numeric IDs and order names like #1001 before joining, or overlap reads zero.

The order-level overlap between affiliate and paid credit is a single join in a warehouse. Load store orders with the click identifiers you captured (gclid, fbc, ttclid and the rest), Refersion conversions with the order ID, affiliate ID, commission, whether a link or a coupon produced the attribution, and the conversion status. Join on order ID, and the output per order is simple: claimed by paid, claimed by an affiliate, both, or neither.

Sum commission on the both rows and you have what the double claim costs. Split those rows by attribution method. Coupon-only overlap, where the order carries a paid click identifier and an influencer code but no affiliate link visit, is the code-leakage case: an ad produced the visit and a code found elsewhere earned the commission.

Two practical traps. Refersion conversions change status after the order, from pending to approved, denied or reversed on refund, so nightly snapshot loads lose history; append each status change with a timestamp. And the order ID format may differ: Shopify exposes both a numeric order ID and an order name like #1001, and Refersion's export and your store export may not use the same one. Normalize before joining, or the overlap reads as zero.

Refersion → BigQuery · what breaks

Why this join usually fails — Refersion → BigQuery

  1. 01

    Whatever join key you decide on never reaches Refersion

    Affiliate links carry their own parameters and land on your store, frequently overwriting or colliding with a paid identifier already stored.

  2. 02

    Influencer codes claiming paid traffic's orders

    A customer sees your ad, searches for a discount code, finds an influencer's, and orders. The influencer earns a commission on a sale your advertising produced, and your paid reporting counts it too.

  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.

Refersion → BigQuery · the fix

What working looks like — Refersion → BigQuery

  • Whatever join key you decide on on every conversion

  • 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

Refersion → BigQuery · architecture

How Refersion and BigQuery actually connect

  1. 1

    Refersion holds the truth

    An affiliate order costs you a commission on top of whatever the ad click cost. If both systems claim it, the order is being paid for twice and neither report mentions the other.

  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 Refersion conversion.

  4. 4

    The event source decides reliability

    Send orders net of affiliate commission, with the affiliate-sourced share marked.

  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.

Refersion → BigQuery · normal or broken

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

Normal, not a fault

  • Whatever join key you decide on present on the conversion

  • Sent from the store order record with Refersion attribution attached

  • 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

    Affiliate links carry their own parameters and land on your store, frequently overwriting or colliding with a paid identifier already stored.

  • Sent from the browser

    A customer sees your ad, searches for a discount code, finds an influencer's, and orders. The influencer earns a commission on a sale your advertising produced, and your paid reporting counts it too.

  • 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

Refersion → BigQuery · diagnose

Diagnostic order — Refersion → BigQuery

  1. 01

    Count conversions carrying whatever join key you decide on

  2. 02

    Follow one real conversion end to end

  3. 03

    Count orders appearing in both paid conversions and Refersion

    The overlap is the double payment. One query, rarely run.

  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.

Refersion → BigQuery · prove

How it gets proven — Refersion → BigQuery

Source of truth

Store orders flagged by whether an affiliate link or code produced them, with the commission recorded.

  • Whatever join key you decide on confirmed present on a live conversion.
  • Warehouse order counts and revenue reconciled against the source system for a fully closed window, with duplicates checked on the join key.
  • Non-affiliate orders reconciled against imported conversions, with the overlap measured and stated.

Refersion → BigQuery · free audit

What we check in the free audit

  • Count conversions carrying whatever join key you decide on
  • Follow one real conversion end to end
  • Count orders appearing in both paid conversions and Refersion
  • Reconcile warehouse order counts against each platform for one closed window
  • Read the match rate, not the success message

Checked against

Store orders flagged by whether an affiliate link or code produced them, with the commission recorded.

Get my free conversion tracking audit

Free30 minutesNo obligation

Refersion → BigQuery · when not to buy

When you don't need this — Refersion → BigQuery

  • Measure identifier coverage yourself first — pull your last hundred conversions and count how many carry whatever join key you decide on.
  • No affiliate programme means no conflict and this reduces to an ordinary store integration.
  • 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.

Refersion → BigQuery · what we deliver

What gets built — Refersion → BigQuery

  • Identifier capture into Refersion

    Set an explicit precedence rule between affiliate and paid parameters rather than letting last-write-wins decide, and record both on the order.

  • Event source: the store order record with Refersion attribution attached

    Send orders net of affiliate commission, with the affiliate-sourced share marked.

  • 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

    Refunds reverse and should claw back the commission.

Written guarantee

95%+ tracking accuracy

Measured against Store orders flagged by whether an affiliate link or code produced them, with the commission recorded.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Refersion → BigQuery questions, answered

Load Refersion conversions and store orders into BigQuery, join on order ID, and flag orders that also carry a stored gclid. Sum commission on that overlap to see what it costs.

Free · 30 min

Get Refersion and BigQuery joined properly

Free30 minutesNo obligation