Connecting Sanity to Google Ads
Sanity is a headless content platform, which means like every headless CMS it holds no commercial record and the tracking question lives elsewhere. Google Ads knows what you spent and which click it came from, and nothing at all about what happened afterwards. The join between them succeeds or fails on one thing: whether the GCLID reaches the front-end conversion, not a Sanity record before the conversion happens, because Google Ads can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Sanity-powered sites and Google Ads: protect the GCLID
Make every editor-managed Sanity redirect preserve the query string so the GCLID survives, and load the Google tag and conversion linker in the root layout so new page-builder templates inherit it. Conversions come from commerce or CRM, with the order ID as transaction ID and enhanced conversions using hashed checkout email.
On headless sites the GCLID is most often lost to redirects. Sanity projects commonly store redirects as documents that editors manage, and the front end applies them in middleware or config. If those redirects do not carry the query string forward, a campaign landing page that was renamed in Sanity silently strips the GCLID before the Google tag loads. Check that every redirect preserves query parameters, and test a live ad URL rather than a typed one.
Conversions come from the commerce or CRM system. For web purchases, the Google tag's conversion should carry the order ID as transaction ID, because on client-rendered sites the confirmation route can fire again on refresh or back-navigation, and Google drops repeat transaction IDs for the same action. Enhanced conversions with the hashed email from checkout improve match rates where the GCLID cookie does not last.
The other pair-specific issue is landing pages built from a Sanity page builder. Marketing can publish a new campaign page in minutes, which is good, but if the conversion linker or Google tag is loaded per page template rather than site-wide, new templates ship without it. Load the tag in the root layout and verify on each new template before pointing ads at it.
Sanity → Google Ads · what breaks
Why this join usually fails — Sanity → Google Ads
- 01
The GCLID never reaches Sanity
The front-end application does the routing, the caching and the identifier capture. Single-page navigation is the usual failure and it belongs to the framework rather than to Sanity.
- 02
A headless stack diagnosed at the wrong layer
Route changes not tracked, identifiers lost between pages — these are front-end framework problems that get filed against the CMS because that is the name everyone knows.
- 03
The conversion action is the wrong type
Uploads against a standard website conversion action fail. The action has to be created as 'Import' — and existing actions cannot be converted, so this is discovered late and requires starting a new action with no history.
- 04
Nothing reconciles afterwards
Google Ads reports uploads in Goals → Conversions → Uploads, with rows accepted and rows failed. A green result means the file parsed, not that the clicks matched. The number to watch is how many conversions actually appear against campaigns afterwards.
Sanity → Google Ads · the fix
What working looks like — Sanity → Google Ads
The GCLID on every conversion
Conversions arriving in Google Ads
Conversions appear against the campaign, ad group and keyword that produced the click, with the value you sent — which is what lets Smart Bidding optimize toward revenue instead of toward form fills.
Reconciled against the source
Sanity → Google Ads · architecture
How Sanity and Google Ads actually connect
- 1
Sanity holds the truth
Sanity's real-time content APIs make it excellent at what it does and irrelevant to conversion measurement. Establishing that early saves the client money.
- 2
Google Ads needs a click to match
Google Ads matches an uploaded conversion back to a click using the GCLID. The conversion action must be created as an import type — an upload against a website-tag conversion action is rejected. Uploads must also land inside Google's window: the click has to be within the last 90 days.
- 3
The identifier is the bridge
The GCLID, captured at the visit and carried into the front-end conversion, not a Sanity record.
- 4
The event source decides reliability
Send from wherever the money is recorded, not from the content layer.
- 5
Deduplication at the destination
Google deduplicates on the combination of GCLID, conversion action and conversion time. Uploading the same click twice against the same action at the same timestamp is rejected rather than double-counted, but uploading it against a second conversion action counts twice — which is how most double-counting here actually happens.
Sanity → Google Ads · normal or broken
Working vs. broken, side by side — Sanity → Google Ads
Normal, not a fault
The GCLID present on the conversion
Sent from your commerce or CRM system
Deduplicated correctly
Google deduplicates on the combination of GCLID, conversion action and conversion time. Uploading the same click twice against the same action at the same timestamp is rejected rather than double-counted, but uploading it against a second conversion action counts twice — which is how most double-counting here actually happens.
Reconciles with the source
Actually broken
The GCLID missing on most records
The front-end application does the routing, the caching and the identifier capture. Single-page navigation is the usual failure and it belongs to the framework rather than to Sanity.
Sent from the browser
Route changes not tracked, identifiers lost between pages — these are front-end framework problems that get filed against the CMS because that is the name everyone knows.
Counted twice, or not at all
Uploads against a standard website conversion action fail. The action has to be created as 'Import' — and existing actions cannot be converted, so this is discovered late and requires starting a new action with no history.
Nobody has reconciled it
Sanity → Google Ads · diagnose
Diagnostic order — Sanity → Google Ads
- 01
Count conversions carrying the GCLID
- 02
Follow one real conversion end to end
- 03
Identify the front-end framework, not the CMS
The routing behaviour that breaks tracking belongs to Next.js, Nuxt or whatever renders the site.
- 04
Check the conversion action type and the upload diagnostics
In Google Ads, Goals → Conversions → Uploads shows every upload with its error rows. Read the errors rather than the success count; a file can import successfully with most rows rejected.
- 05
Read the match rate, not the success message
Google Ads reports uploads in Goals → Conversions → Uploads, with rows accepted and rows failed. A green result means the file parsed, not that the clicks matched. The number to watch is how many conversions actually appear against campaigns afterwards.
Sanity → Google Ads · prove
How it gets proven — Sanity → Google Ads
Source of truth
Your commerce, CRM or billing system — Sanity has no orders and no customers.
- The GCLID confirmed present on a live conversion.
- The Uploads diagnostics read row by row, with the accepted count reconciled against conversions appearing in campaign reporting.
- The conversion confirmed sourced from the commerce system, with front-end routing verified separately.
Sanity → Google Ads · free audit
What we check in the free audit
- Count conversions carrying the GCLID
- Follow one real conversion end to end
- Identify the front-end framework, not the CMS
- Check the conversion action type and the upload diagnostics
- Read the match rate, not the success message
Checked against
Your commerce, CRM or billing system — Sanity has no orders and no customers.
Free30 minutesNo obligation
Sanity → Google Ads · when not to buy
When you don't need this — Sanity → Google Ads
- Measure identifier coverage yourself first — pull your last hundred conversions and count how many carry the GCLID.
- There is no Sanity-specific build. Fix the front end and the commerce integration; the CMS is not in the path.
- If your sales close inside a few days and your website tag already reports accurately, you may not need offline import at all. It exists to solve the delay between click and revenue.
Sanity → Google Ads · what we deliver
What gets built — Sanity → Google Ads
Identifier capture into Sanity
Capture and persist the identifier server-side in the front-end application, then carry it into the system that records the sale.
Event source: your commerce or CRM system
Send from wherever the money is recorded, not from the content layer.
Dispatch to Google Ads
Offline Conversion Import through the Google Ads API, or a scheduled upload. Enhanced conversions for leads where GCLID coverage is poor and you have consented email addresses.
Reversals where they exist
Handled by the commerce system.
Written guarantee
95%+ tracking accuracy
Measured against Your commerce, CRM or billing system — Sanity has no orders and no customers.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Sanity → Google Ads questions, answered
Usually a redirect is dropping the query string before the tag reads it. Check redirects managed in Sanity and in the framework config.
Send the order ID as the conversion's transaction ID. Google ignores a repeat of the same ID for the same conversion action.
Almost always because the GCLID never reached the front-end conversion, not a Sanity record. The front-end application does the routing, the caching and the identifier capture. Single-page navigation is the usual failure and it belongs to the framework rather than to Sanity. Measure coverage before debugging the dispatch.
The GCLID — the click ID Google appends to your landing page URL when auto-tagging is on. For iOS App campaigns and some Shopping traffic you will see GBRAID or WBRAID instead, and those behave differently: WBRAID cannot be used with user-provided data in the same way, and neither joins to an individual user. Enhanced conversions for leads is the alternative path, matching on hashed email or phone rather than a click ID, and it is the right choice when GCLID coverage is poor.
Your commerce or CRM system. Send from wherever the money is recorded, not from the content layer.
Google Ads reports uploads in Goals → Conversions → Uploads, with rows accepted and rows failed. A green result means the file parsed, not that the clicks matched. The number to watch is how many conversions actually appear against campaigns afterwards.
More on Sanity → Google Ads
- Google Ads · Lead → booked callHow to track lead to booked call for Google Ads
- Google Ads · Booked call → closed wonHow to track booked call to closed won for Google Ads
- Google Ads · Free trial → paidHow to track free trial to paid for Google Ads
RELATED GUIDES
Where Sanity → Google Ads fits in the rest of your tracking
- Google Ads · Local servicesGoogle Ads conversion tracking for local service businesses
- Google Ads · B2BGoogle Ads conversion tracking for B2B companies
- Google Ads × Ecommerce OrdersHow to reconcile Google Ads against your store's order table
- Google Ads · Comparison page → demoHow to track comparison page visit to demo request for Google Ads
- Ghost → Google AdsConnecting Ghost memberships to Google Ads
- Sanity → Amazon AdsConnecting Sanity to Amazon Ads
- Local servicesConversion tracking for local businesses, where most conversions bypass the website
- Duda → Google AdsConnecting Duda to Google Ads
Free · 30 min
Get Sanity and Google Ads joined properly
Free30 minutesNo obligation
