Connecting Friendbuy to BigQuery
Friendbuy runs customer-to-customer referral, which means the acquisition was produced by an existing customer and paid for with a reward on both sides. 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 Friendbuy referral 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
Friendbuy to BigQuery: decide referral precedence in SQL, not cookies
Load both raw into BigQuery: every paid click ID and Friendbuy referral arrival with timestamps against the visitor, plus orders with referral flags and Friendbuy reward records, so precedence becomes a rerunnable query. Join on order ID and customer ID, model rewards as their own status table with clawbacks as rows, and reconcile non-referral orders against platform-reported conversions.
The warehouse fixes the problem every other destination inherits: last-write-wins identifier storage. Instead of letting the browser decide whether a Friendbuy referral or a paid click owns an order, load both raw. Store every paid click identifier and every Friendbuy referral arrival with its timestamp against the visitor, and load orders with the referral flag and reward records from Friendbuy. Precedence then becomes a query you can change and rerun, not a cookie someone set two years ago.
The join key is the order ID for the order itself and your customer ID for the advocate and friend. A double-sided referral needs two cost rows, the friend's discount on the order and the advocate's reward when it is issued, which is often days later and sometimes conditional on the order not being refunded. Model rewards as their own table with status, so a clawback on refund is a row, not a silent edit.
The result is a cost per referred customer you can put next to cost per paid customer, computed from your own data. Reconcile non-referral orders against each ad platform's reported conversions for a closed window; if the gap shrinks when you apply your precedence rule, that rule was the reason paid reporting looked too good.
Friendbuy → BigQuery · what breaks
Why this join usually fails — Friendbuy → BigQuery
- 01
Whatever join key you decide on never reaches Friendbuy
Referral links route through Friendbuy and land on your store with their own parameters, potentially overwriting a stored paid identifier.
- 02
Word of mouth billed to the ad account
The better your referral programme performs, the worse your paid reporting gets — a genuinely perverse outcome caused entirely by last-write-wins identifier storage that nobody consciously chose.
- 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.
- 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.
Friendbuy → BigQuery · the fix
What working looks like — Friendbuy → BigQuery
Whatever join key you decide on on every referral
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
Friendbuy → BigQuery · architecture
How Friendbuy and BigQuery actually connect
- 1
Friendbuy holds the truth
A double-sided referral costs you two discounts to acquire one customer. That is a real and known acquisition cost, and it sits nowhere near the ad account that will otherwise claim the sale.
- 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
The identifier is the bridge
Whatever join key you decide on, captured at the visit and carried into the Friendbuy referral.
- 4
The event source decides reliability
Send orders net of both referral rewards, with referral-sourced orders marked and held out of paid conversion imports.
- 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.
Friendbuy → BigQuery · normal or broken
Working vs. broken, side by side — Friendbuy → BigQuery
Normal, not a fault
Whatever join key you decide on present on the referral
Sent from your order feed with referral attribution
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
Referral links route through Friendbuy and land on your store with their own parameters, potentially overwriting a stored paid identifier.
Sent from the browser
The better your referral programme performs, the worse your paid reporting gets — a genuinely perverse outcome caused entirely by last-write-wins identifier storage that nobody consciously chose.
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
Friendbuy → BigQuery · diagnose
Diagnostic order — Friendbuy → BigQuery
- 01
Count referrals carrying whatever join key you decide on
- 02
Follow one real conversion end to end
- 03
Check precedence between referral and paid parameters
Whichever wins decides who gets credit, and almost nobody has decided it deliberately.
- 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.
- 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.
Friendbuy → BigQuery · prove
How it gets proven — Friendbuy → BigQuery
Source of truth
Orders flagged by whether a referral produced them, with both reward costs recorded.
- Whatever join key you decide on confirmed present on a live referral.
- Warehouse order counts and revenue reconciled against the source system for a fully closed window, with duplicates checked on the join key.
- Non-referral orders reconciled against imported conversions, with referral volume and reward cost reported separately.
Friendbuy → BigQuery · free audit
What we check in the free audit
- Count referrals carrying whatever join key you decide on
- Follow one real conversion end to end
- Check precedence between referral and paid parameters
- Reconcile warehouse order counts against each platform for one closed window
- Read the match rate, not the success message
Checked against
Orders flagged by whether a referral produced them, with both reward costs recorded.
Free30 minutesNo obligation
Friendbuy → BigQuery · when not to buy
When you don't need this — Friendbuy → BigQuery
- Measure identifier coverage yourself first — pull your last hundred referrals and count how many carry whatever join key you decide on.
- No referral programme means no conflict and this is 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.
Friendbuy → BigQuery · what we deliver
What gets built — Friendbuy → BigQuery
Identifier capture into Friendbuy
Apply an explicit precedence rule between referral and paid parameters and record both on the order.
Event source: your order feed with referral attribution
Send orders net of both referral rewards, with referral-sourced orders marked and held out of paid conversion imports.
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 reclaim rewards.
Written guarantee
95%+ tracking accuracy
Measured against Orders flagged by whether a referral produced them, with both reward costs recorded.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Friendbuy → BigQuery questions, answered
Sum the friend's discount and the advocate's reward per referred order from a rewards table joined on order ID, and divide by referred first orders for the period.
So precedence can be decided and changed in SQL. Storing only the last one loses the evidence you need to check whether paid channels were credited for referral sales.
Almost always because whatever join key you decide on never reached the Friendbuy referral. Referral links route through Friendbuy and land on your store with their own parameters, potentially overwriting a stored paid identifier. Measure coverage before debugging the dispatch.
There is no vendor identifier here. You choose the key — order ID, user ID, click identifier, hashed email — and you live with the consequences. That is the whole appeal and the whole risk: nothing is standardised for you and nothing is silently wrong in a vendor's favour either.
Your order feed with referral attribution. Send orders net of both referral rewards, with referral-sourced orders marked and held out of paid conversion imports.
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.
More on Friendbuy → BigQuery
- Stripe → BigQueryConnecting Stripe to BigQuery
- PayPal → BigQueryConnecting PayPal to BigQuery
- Shopify → BigQueryConnecting Shopify to BigQuery
RELATED GUIDES
Where Friendbuy → BigQuery fits in the rest of your tracking
- Talkable → BigQueryConnecting Talkable to BigQuery
- Extole → BigQueryConnecting Extole to BigQuery
- ReferralCandy → BigQueryConnecting ReferralCandy to BigQuery
- Friendbuy → SegmentConnecting Friendbuy to Segment
- Friendbuy → SnowflakeConnecting Friendbuy to Snowflake
- Subscription boxesConversion tracking for subscription boxes, measured in retained subscribers
Free · 30 min
Get Friendbuy and BigQuery joined properly
Free30 minutesNo obligation
