Connecting Xero to GA4
Xero holds the invoice and the reconciliation, which makes it the definitive revenue record for many service and trade businesses. GA4 is where the business goes to understand what happened, which makes an unattributed conversion there expensive in decisions rather than in ad spend. The join between them succeeds or fails on one thing: whether the GA4 client_id reaches the Xero invoice before the conversion happens, because GA4 can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Xero to GA4: reporting paid invoices by original channel
Capture the GA4 client_id on the inquiry form, store it with the lead and carry it onto the Xero contact. When Xero reports the invoice paid, send purchase via Measurement Protocol with that client_id, the invoice number as transaction_id and the amount paid. GA4 records it on the send date; send credit notes as refunds.
For a service business invoicing from Xero, the GA4 question is which channels bring work that gets paid, not just inquiries. The inquiry form is the only point with a GA4 session, so capture the client_id there and store it with the lead, then carry it onto the Xero contact when the customer is set up, so it is still available when an invoice is paid two months later.
When Xero reports the invoice paid, send purchase via Measurement Protocol with the stored client_id, the Xero invoice number as transaction_id and the amount paid. GA4 will record it on the day you send it, and Measurement Protocol cannot backdate more than a few days, so a March inquiry paid in May shows as May revenue. Analyze inquiry-to-payment in Explorations with a user-scoped dimension for lead source, or in BigQuery, rather than reading the standard acquisition report as cash collected per month.
Repeat invoices to the same contact will all carry the same client_id and keep crediting the channel that brought the first inquiry. That is often what you want for lifetime value, but decide it deliberately: send first-invoice revenue as purchase and later invoices as a separate custom event if repeat work should not count as acquisition. Credit notes should go as refund events against the original transaction_id.
Xero → GA4 · what breaks
Why this join usually fails — Xero → GA4
- 01
The GA4 client_id 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
Everything lands under (direct)/(none)
The classic Measurement Protocol symptom, and it always means the same thing: the client_id was missing or wrong, so GA4 had no session to attach the event to and invented a new user.
- 04
Nothing reconciles afterwards
GA4 DebugView shows events arriving with their parameters, and Realtime confirms the user and session they attached to. Neither tells you whether you are double-counting — for that, compare GA4's conversion count against the source system's record for the same window.
Xero → GA4 · the fix
What working looks like — Xero → GA4
The GA4 client_id on every invoice
Conversions arriving in GA4
Conversions appear in GA4 attributed to the original session's source and medium, so acquisition reporting reflects what actually drove revenue.
Reconciled against the source
Xero → GA4 · architecture
How Xero and GA4 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
GA4 needs a click to match
GA4 needs the client_id to attach a server event to the user and session that produced the click. Without it there is no attribution to inherit and the event is orphaned.
- 3
The identifier is the bridge
The GA4 client_id, 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
GA4 has no built-in deduplication for Measurement Protocol. If the browser also sends the event, it counts twice. The only reliable approach is to decide per event which side sends it, and enforce that decision — GA4 will not protect you from your own duplicates.
Xero → GA4 · normal or broken
Working vs. broken, side by side — Xero → GA4
Normal, not a fault
The GA4 client_id present on the invoice
Sent from the Xero invoice payment webhook
Deduplicated correctly
GA4 has no built-in deduplication for Measurement Protocol. If the browser also sends the event, it counts twice. The only reliable approach is to decide per event which side sends it, and enforce that decision — GA4 will not protect you from your own duplicates.
Reconciles with the source
Actually broken
The GA4 client_id 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
The classic Measurement Protocol symptom, and it always means the same thing: the client_id was missing or wrong, so GA4 had no session to attach the event to and invented a new user.
Nobody has reconciled it
Xero → GA4 · diagnose
Diagnostic order — Xero → GA4
- 01
Count invoices carrying the GA4 client_id
- 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
Check whether server events carry a session and a source
In GA4 Realtime or DebugView, find the event and look at its session and traffic source. A brand-new user with no source on every server event is the missing-client_id signature.
- 05
Read the match rate, not the success message
GA4 DebugView shows events arriving with their parameters, and Realtime confirms the user and session they attached to. Neither tells you whether you are double-counting — for that, compare GA4's conversion count against the source system's record for the same window.
Xero → GA4 · prove
How it gets proven — Xero → GA4
Source of truth
Xero's paid invoices by payment date, reconciled against the bank feed.
- The GA4 client_id confirmed present on a live invoice.
- Server events confirmed in DebugView attaching to an existing session with the original traffic source intact.
- A paid invoice confirmed reconciled against the bank feed before being counted.
Xero → GA4 · free audit
What we check in the free audit
- Count invoices carrying the GA4 client_id
- Follow one real conversion end to end
- Check whether the conversion fires on issue or on payment
- Check whether server events carry a session and a source
- 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 → GA4 · when not to buy
When you don't need this — Xero → GA4
- Measure identifier coverage yourself first — pull your last hundred invoices and count how many carry the GA4 client_id.
- If your work is paid at point of sale with no invoicing, the accounting system is not where the conversion should come from.
- GA4 is reporting, not bidding. If your problem is ad platform optimization, fix the ad platform destination first — GA4 will not change what any campaign does.
Xero → GA4 · what we deliver
What gets built — Xero → GA4
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 GA4
Measurement Protocol events with the client_id, session_id and the correct measurement ID and API secret, sent server-side.
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 → GA4 questions, answered
Yes, via Measurement Protocol, if the GA4 client_id from the inquiry was stored and carried to the Xero contact. Without it the payment lands under (direct)/(none).
GA4 records the event when it is sent, which is the payment date. Analyze inquiry-to-payment as a cohort instead.
Almost always because the GA4 client_id 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.
The client_id, from the _ga cookie. Measurement Protocol events without it are rejected or create a brand-new user with no session and no source, which is how server events end up filed under (direct)/(none) and make paid channels look worse than they are. Send session_id alongside it so the event joins the existing session, and include engagement_time_msec or the event may not appear as expected in reports.
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.
GA4 DebugView shows events arriving with their parameters, and Realtime confirms the user and session they attached to. Neither tells you whether you are double-counting — for that, compare GA4's conversion count against the source system's record for the same window.
More on Xero → GA4
- Stripe → GA4Connecting Stripe to GA4
- PayPal → GA4Connecting PayPal to GA4
- HubSpot → GA4Connecting HubSpot to GA4
RELATED GUIDES
Where Xero → GA4 fits in the rest of your tracking
- FreshBooks → GA4Connecting FreshBooks to GA4
- Wave → GA4Connecting Wave to GA4
- BILL → GA4Connecting BILL to GA4
- Xero → MixpanelConnecting Xero to Mixpanel
- Xero → Adobe AnalyticsConnecting Xero to Adobe Analytics
- BookkeepingConversion tracking for bookkeeping firms, valued on the retainer not the enquiry
- Harvest → GA4Connecting Harvest to GA4
- QuickBooks → GA4Connecting QuickBooks to GA4
