Skip to main content
Xero → GA4Integration guide

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

  1. 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.

  2. 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.

  3. 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.

  4. 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. 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. 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. 3

    The identifier is the bridge

    The GA4 client_id, captured at the visit and carried into the Xero invoice.

  4. 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. 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

  1. 01

    Count invoices carrying the GA4 client_id

  2. 02

    Follow one real conversion end to end

  3. 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.

  4. 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.

  5. 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.

Get my free conversion tracking audit

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.

Get my free conversion tracking audit

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).

Free · 30 min

Get Xero and GA4 joined properly

Free30 minutesNo obligation