Skip to main content
Sanity → Google AdsIntegration guide

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

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

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

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

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

    The identifier is the bridge

    The GCLID, captured at the visit and carried into the front-end conversion, not a Sanity record.

  4. 4

    The event source decides reliability

    Send from wherever the money is recorded, not from the content layer.

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

  1. 01

    Count conversions carrying the GCLID

  2. 02

    Follow one real conversion end to end

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

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

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

Get my free conversion tracking audit

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.

Get my free conversion tracking audit

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.

Free · 30 min

Get Sanity and Google Ads joined properly

Free30 minutesNo obligation