Connecting Xero to BigQuery
Xero holds the invoice and the reconciliation, which makes it the definitive revenue record for many service and trade businesses. 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 Xero invoice 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
Xero to BigQuery: paid, reconciled invoices joined to click IDs
Load Xero invoices, payments and credit notes into BigQuery as separate tables, keeping the bank-reconciled flag. Join through a mapping of the Xero contact ID to the CRM lead ID that holds gclid, fbclid or UTMs, since tracking categories cannot hold click IDs. Deduplicate on invoice ID, report cash by payment date, then send paid-invoice conversions to ad platforms.
BigQuery is the natural place to combine Xero's money with your marketing data. Load invoices, payments and credit notes as separate tables, with contact ID, invoice number, amounts, issue date, payment date, and whether the payment is reconciled to the bank feed. That last field is what makes Xero data more trustworthy than most sources, so keep it rather than flattening it away.
The join key is the Xero contact ID mapped to the lead record that captured gclid, fbclid or UTMs. Xero limits the number of active tracking categories (check the current limit for your organization), so they can hold a channel name at most, never a per-click ID. Store the CRM lead ID against the contact, in your own mapping table or a contact field you have confirmed is unused, and join through it.
Report cash by payment date and pipeline by invoice date, and say which one a chart uses. Deduplicate on invoice ID per load, since pulling changes by modified date returns the same invoice after every edit. With that in place, a scheduled query can send paid-invoice conversions to ad platforms with the click IDs from the lead, inside each platform's upload window.
Xero → BigQuery · what breaks
Why this join usually fails — Xero → BigQuery
- 01
Whatever join key you decide on never reaches Xero
Like any accounting system, Xero has no marketing context of its own. The identifier must be written onto the contact record by whatever creates it, and in many businesses that is a manual step which will be applied inconsistently unless it is automated.
- 02
Payment terms separating the sale from the money
An invoice issued in March and paid in May is one sale and two dates. Which one the conversion uses has to be a decision rather than an accident.
- 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.
Xero → BigQuery · the fix
What working looks like — Xero → BigQuery
Whatever join key you decide on on every invoice
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
Xero → BigQuery · architecture
How Xero and BigQuery actually connect
- 1
Xero holds the truth
Xero's bank reconciliation is what makes it unusually trustworthy as a source of truth — an invoice marked paid and reconciled is money that actually arrived, which is a stronger guarantee than most systems offer.
- 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 Xero invoice.
- 4
The event source decides reliability
Fire on payment, not on invoice issue. Trade businesses on thirty-day terms will otherwise report revenue a month before it exists.
- 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.
Xero → BigQuery · normal or broken
Working vs. broken, side by side — Xero → BigQuery
Normal, not a fault
Whatever join key you decide on present on the invoice
Sent from the Xero invoice payment 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
Like any accounting system, Xero has no marketing context of its own. The identifier must be written onto the contact record by whatever creates it, and in many businesses that is a manual step which will be applied inconsistently unless it is automated.
Sent from the browser
An invoice issued in March and paid in May is one sale and two dates. Which one the conversion uses has to be a decision rather than an accident.
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
Xero → BigQuery · diagnose
Diagnostic order — Xero → BigQuery
- 01
Count invoices carrying whatever join key you decide on
- 02
Follow one real conversion end to end
- 03
Check whether the conversion fires on issue or on payment
On terms-based businesses this single choice moves the numbers by a full billing cycle.
- 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.
Xero → BigQuery · prove
How it gets proven — Xero → BigQuery
Source of truth
Xero's paid invoices by payment date, reconciled against the bank feed.
- Whatever join key you decide on confirmed present on a live invoice.
- Warehouse order counts and revenue reconciled against the source system for a fully closed window, with duplicates checked on the join key.
- A paid invoice confirmed reconciled against the bank feed before being counted.
Xero → BigQuery · free audit
What we check in the free audit
- Count invoices carrying whatever join key you decide on
- Follow one real conversion end to end
- Check whether the conversion fires on issue or on payment
- Reconcile warehouse order counts against each platform for one closed window
- Read the match rate, not the success message
Checked against
Xero's paid invoices by payment date, reconciled against the bank feed.
Free30 minutesNo obligation
Xero → BigQuery · when not to buy
When you don't need this — Xero → BigQuery
- Measure identifier coverage yourself first — pull your last hundred invoices and count how many carry whatever join key you decide on.
- If your work is paid at point of sale with no invoicing, the accounting system is not where the conversion should come from.
- 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.
Xero → BigQuery · what we deliver
What gets built — Xero → BigQuery
Identifier capture into Xero
Write the click identifier to a tracking category or a custom field on the Xero contact at creation, so subsequent invoices inherit the association.
Event source: the Xero invoice payment webhook
Fire on payment, not on invoice issue. Trade businesses on thirty-day terms will otherwise report revenue a month before it exists.
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
Credit notes reverse against the original invoice and should reduce the reported figure.
Written guarantee
95%+ tracking accuracy
Measured against Xero's paid invoices by payment date, reconciled against the bank feed.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Xero → BigQuery questions, answered
Use Xero's API with a scheduled job, or an ETL tool with a Xero connector, landing invoices, payments and credit notes in raw tables deduplicated on their IDs.
Not practically, since tracking categories are limited and meant for reporting. Store it on the lead in your CRM and map the Xero contact to that lead.
Almost always because whatever join key you decide on never reached the Xero invoice. Like any accounting system, Xero has no marketing context of its own. The identifier must be written onto the contact record by whatever creates it, and in many businesses that is a manual step which will be applied inconsistently unless it is automated. 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.
The Xero invoice payment webhook. Fire on payment, not on invoice issue. Trade businesses on thirty-day terms will otherwise report revenue a month before it exists.
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 Xero → BigQuery
- Xero → Google AdsConnecting Xero to Google Ads
- Xero → MetaConnecting Xero to Meta Conversions API
- Xero → GA4Connecting Xero to GA4
RELATED GUIDES
Where Xero → BigQuery fits in the rest of your tracking
- FreshBooks → BigQueryConnecting FreshBooks to BigQuery
- QuickBooks → BigQueryConnecting QuickBooks to BigQuery
- Wave → BigQueryConnecting Wave to BigQuery
- Xero → SnowflakeConnecting Xero to Snowflake
- Xero → SegmentConnecting Xero to Segment
- Accounting and CPAConversion tracking for accounting firms, measured in engagements
- BILL → BigQueryConnecting BILL to BigQuery
- Harvest → BigQueryConnecting Harvest to BigQuery
Free · 30 min
Get Xero and BigQuery joined properly
Free30 minutesNo obligation
