Machina

Machina — Marketing that moves numbers.

Reach out today
Technology

Closed-loop GTM attribution: passing first-touch UTMs and GCLIDs from website to revenue

If marketing measures form submissions in Google Analytics while sales tracks revenue in a CRM, neither team can prove which channel pays back. Closing the loop requires four concrete pieces of plumbing: write-once first-touch capture on arrival, a shared lead identifier, verified server-side events and offline conversion uploads tied to real revenue.

Francisco Contreras

Francisco Contreras · Founder, Machina

4 min read

An open vermilion ring whose gap is closed by a dotted cream arc, on a black ground

Why default website tracking loses attribution before the form submits

Example: Suppose a buyer clicks a Google Ad into /services/go-to-market?gclid=abc&utm_source=google&utm_medium=cpc, reads a case study, checks a guide page, and then submits a form on /contact. By the time they reach /contact, the URL query string is gone. Without first-party persistence, your CRM logs the lead as "Direct" and your ad account never learns that the click turned into a $40,000 deal.

In our 66,000-word, 16-chapter audit of one live GA4 property, How to Build a World-Class GA4 Setup, we documented concrete configuration defects that silently break attribution: a server-side endpoint pointed at a 404 hostname and GA4 event retention left at its default 2-month setting (standard GA4 properties allow up to 14 months for Exploration event data). On that single site (29 leads), 20 leads (69%) carried a GA client ID while 9 (31%) did not; the cause of the missing 31% was not established.

Four steps to engineer closed-loop attribution

  1. 1

    Capture first-touch metadata on entry

    Run a lightweight first-party script on every page that checks for UTMs, click IDs (gclid, fbclid, wbraid, gbraid), landing path and external referrer. Write them once to first-party storage so internal navigation never overwrites the original source. Validate your tag rules first with our free UTM Builder.
  2. 2

    Attach a shared lead_id at submission

    When the visitor submits a form, generate a deterministic lead_id and post both the contact fields and the persisted attribution payload to your backend route—never relying on browser pixels alone.
  3. 3

    Write immutable CRM properties

    Store first_touch_* and gclid in write-once CRM properties alongside mutable last_touch_* fields. Never overwrite first-touch attribution when a prospect downloads a second guide three weeks later.
  4. 4

    Upload verified offline conversions

    When a deal hits Qualified Opportunity or Closed-Won (or a booked job completes), fire an automated upload sending the stored click ID, hashed user-provided identifiers and actual dollar value back to Google Ads via Offline Conversion Imports and Enhanced Conversions for Leads.

FAQ

Frequently asked questions

Will every form lead carry a first-party GA client ID or click ID?

No. In our audit of one live GA4 property (29 leads), 20 leads (69%) carried a GA client ID and 9 (31%) did not, without establishing the exact cause of the missing 31%. Skip missing client IDs rather than fabricating them so observed attribution stays trustworthy, and pair click IDs with Enhanced Conversions for Leads where consent allows.

Does closed-loop attribution work for phone-call-driven local businesses?

Yes. Dynamic number insertion (DNI) captures the visitor’s click ID and UTM tags per call session, writes them into the CRM alongside form leads and uploads booked-job revenue back to Google Ads once the job closes.

Next steps

Let's talk about your project

Tell us what you're working on. We'll tell you if we can help — and exactly what we'd do.

We use cookies and analytics to understand how visitors use our site and improve your experience. Privacy Policy · Do Not Sell or Share My Personal Information