Connecting Sanity to Microsoft Ads
Sanity is a headless content platform, which means like every headless CMS it holds no commercial record and the tracking question lives elsewhere. Microsoft Ads reaches an older, higher-income, more desktop-weighted audience than Google, and it is routinely the cheapest qualified traffic a B2B advertiser can buy. The join between them succeeds or fails on one thing: whether the MSCLKID reaches the front-end conversion, not a Sanity record before the conversion happens, because Microsoft Ads can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Sanity sites and Microsoft UET on client-side routing
Enable UET's automatic SPA tracking, or send page views on route change, so thank-you goals count. Capture the MSCLKID per request in middleware into a first-party cookie, carry it into the CRM lead or commerce order, and run the offline import from there. Never render click IDs into cached HTML, and confirm auto-tagging is on.
On a Sanity-backed front end, the UET tag sees the first page load and then nothing unless single-page tracking is switched on. Microsoft's UET tag has an option for automatic SPA tracking; check that it is enabled in your tag configuration, or send page views manually on route change. Destination-URL goals for thank-you pages silently undercount without it.
Capture the MSCLKID in the front end's middleware or server on the first request and set a first-party cookie, then carry it into whichever system records the sale, a CRM lead or a commerce order. The offline import runs from that system. Sanity holds no orders, so there is nothing to upload from the CMS itself.
Static generation adds a trap that only headless sites have. Pages built ahead of time or cached at the edge must never have the MSCLKID or any click identifier rendered into the HTML, or one visitor's identifier gets served to everyone who loads that cached page. Read identifiers per request in middleware or in the browser, never in the data-fetching step that builds the page from Sanity content. Then check one thing in the Microsoft account itself: auto-tagging, which is often off in accounts imported from Google.
Sanity → Microsoft Ads · what breaks
Why this join usually fails — Sanity → Microsoft Ads
- 01
The MSCLKID 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
Auto-tagging switched off
Microsoft auto-tagging is frequently disabled in accounts that were set up quickly or imported from Google, and without it no MSCLKID arrives at all — so the entire offline import has nothing to match against and fails silently.
- 04
Nothing reconciles afterwards
Microsoft Ads reports offline conversion uploads with rows accepted and rejected. A successful upload is not a matched conversion — check that conversions actually appear against campaigns afterwards.
Sanity → Microsoft Ads · the fix
What working looks like — Sanity → Microsoft Ads
The MSCLKID on every conversion
Conversions arriving in Microsoft Ads
Conversions appear against the campaign, ad group and keyword that produced the click, with the value you sent, and become usable for automated bidding.
Reconciled against the source
Sanity → Microsoft Ads · architecture
How Sanity and Microsoft 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
Microsoft Ads needs a click to match
Microsoft matches uploaded conversions to clicks using the MSCLKID, and the conversion goal must be created as an offline conversion type. The click has to fall inside Microsoft's import window — verify the current limit in your account rather than assuming it matches Google's.
- 3
The identifier is the bridge
The MSCLKID, 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
Microsoft deduplicates on the combination of click identifier, conversion name and conversion time. Uploading the same click against a second conversion goal counts twice, which is the usual cause of inflated numbers here.
Sanity → Microsoft Ads · normal or broken
Working vs. broken, side by side — Sanity → Microsoft Ads
Normal, not a fault
The MSCLKID present on the conversion
Sent from your commerce or CRM system
Deduplicated correctly
Microsoft deduplicates on the combination of click identifier, conversion name and conversion time. Uploading the same click against a second conversion goal counts twice, which is the usual cause of inflated numbers here.
Reconciles with the source
Actually broken
The MSCLKID 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
Microsoft auto-tagging is frequently disabled in accounts that were set up quickly or imported from Google, and without it no MSCLKID arrives at all — so the entire offline import has nothing to match against and fails silently.
Nobody has reconciled it
Sanity → Microsoft Ads · diagnose
Diagnostic order — Sanity → Microsoft Ads
- 01
Count conversions carrying the MSCLKID
- 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
Confirm auto-tagging is enabled and check the upload diagnostics
One account setting decides whether any of this works. Then read the per-row errors on the upload rather than the success count.
- 05
Read the match rate, not the success message
Microsoft Ads reports offline conversion uploads with rows accepted and rejected. A successful upload is not a matched conversion — check that conversions actually appear against campaigns afterwards.
Sanity → Microsoft Ads · prove
How it gets proven — Sanity → Microsoft Ads
Source of truth
Your commerce, CRM or billing system — Sanity has no orders and no customers.
- The MSCLKID confirmed present on a live conversion.
- Auto-tagging confirmed on, and 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 → Microsoft Ads · free audit
What we check in the free audit
- Count conversions carrying the MSCLKID
- Follow one real conversion end to end
- Identify the front-end framework, not the CMS
- Confirm auto-tagging is enabled and check 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 → Microsoft Ads · when not to buy
When you don't need this — Sanity → Microsoft Ads
- Measure identifier coverage yourself first — pull your last hundred conversions and count how many carry the MSCLKID.
- There is no Sanity-specific build. Fix the front end and the commerce integration; the CMS is not in the path.
- If you are not running Microsoft Ads at meaningful spend, skip it — though for B2B the traffic is often cheaper and better qualified than people expect, which is worth testing before dismissing.
Sanity → Microsoft Ads · what we deliver
What gets built — Sanity → Microsoft 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 Microsoft Ads
Offline conversion import through the Microsoft Advertising API or a scheduled upload.
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 → Microsoft Ads questions, answered
Only if automatic SPA tracking is enabled in the UET tag or you send page views on each route change. Check your tag configuration.
From the CRM or commerce system that records the sale, joined to the MSCLKID captured on landing. Sanity holds no conversion records.
Almost always because the MSCLKID 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 MSCLKID, appended to your landing page URL when auto-tagging is enabled in the Microsoft Ads account. Auto-tagging is not on by default in every account, which is the single most common reason a Microsoft offline import finds nothing to match. Microsoft also supports enhanced conversions using hashed customer data as an alternative path.
Your commerce or CRM system. Send from wherever the money is recorded, not from the content layer.
Microsoft Ads reports offline conversion uploads with rows accepted and rejected. A successful upload is not a matched conversion — check that conversions actually appear against campaigns afterwards.
More on Sanity → Microsoft Ads
- Microsoft · Lead → booked callHow to track lead to booked call for Microsoft Ads
- Microsoft · Booked call → closed wonHow to track booked call to closed won for Microsoft Ads
- Microsoft · Free trial → paidHow to track free trial to paid for Microsoft Ads
RELATED GUIDES
Where Sanity → Microsoft Ads fits in the rest of your tracking
- Microsoft · Local servicesMicrosoft Ads conversion tracking for local service businesses
- Microsoft · B2BMicrosoft Ads conversion tracking for B2B companies
- Microsoft × CRM DealsHow to reconcile Microsoft Ads against your CRM's closed-won deals
- Microsoft · Comparison page → demoHow to track comparison page visit to demo request for Microsoft Ads
- Craft → Microsoft AdsConnecting Craft CMS to Microsoft Ads
- Sanity → Google AdsConnecting Sanity to Google Ads
- Local servicesConversion tracking for local businesses, where most conversions bypass the website
- Contentful → Microsoft AdsConnecting Contentful to Microsoft Ads
Free · 30 min
Get Sanity and Microsoft Ads joined properly
Free30 minutesNo obligation
