Skip to main content
Sanity → CriteoIntegration guide

Connecting Sanity to Criteo

Sanity is a headless content platform, which means like every headless CMS it holds no commercial record and the tracking question lives elsewhere. Criteo is a retargeting and commerce media network built on product-level data, which means its feed matters as much as its conversion events. The join between them succeeds or fails on one thing: whether the Criteo user identifier and product IDs reaches the front-end conversion, not a Sanity record before the conversion happens, because Criteo can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Sanity product content and Criteo: build the feed on commerce IDs

Generate Criteo's catalog feed from the commerce system, using the same product ID the order webhook sends, and enrich it with Sanity titles, images and copy joined on the commerce reference in Sanity product documents. Front-end product and cart tags must send commerce IDs, not Sanity _ids. Send sales server-side from commerce with the order ID.

Some headless stores keep product descriptions and images in Sanity and prices, inventory and SKUs in the commerce engine. Criteo needs a catalog feed whose product IDs match the IDs in your sale events exactly. If someone builds the feed from Sanity documents, it ends up keyed on Sanity _ids or slugs while orders carry the commerce engine's variant IDs, and Criteo can't resolve a single sale.

Generate the feed from the commerce system, using the same ID the order webhook sends, and enrich it with Sanity content (titles, images, copy) joined on whatever reference field your Sanity product documents hold for the commerce product. Check that reference is populated for every product; one without a match either falls back to the commerce system's bare content or drops out of the feed.

On the front end, Criteo's product view and cart tags must also send commerce IDs, which is easy to get wrong when the page component reads its data from Sanity and the nearest ID to hand is the document _id. Inspect the tag on a live product page and compare its ID to the feed. Send the sale from the commerce system server-side, with the order ID as the transaction ID; Sanity plays no part in that event.

Sanity → Criteo · what breaks

Why this join usually fails — Sanity → Criteo

  1. 01

    The Criteo user identifier and product IDs 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

    Product IDs that do not match the feed

    Criteo resolves conversions against your catalogue. If the IDs in your purchase events differ from the IDs in your feed — a common outcome when the feed is generated by a different system — the conversion resolves poorly and the reported value is wrong.

  4. 04

    Nothing reconciles afterwards

    Criteo reports conversions on its own attribution windows, which include view-through. Reconcile against your own order records and be explicit that view-through credit is included — otherwise the comparison will never balance.

Sanity → Criteo · the fix

What working looks like — Sanity → Criteo

  • The Criteo user identifier and product IDs on every conversion

  • Conversions arriving in Criteo

    Conversions appear in Criteo's reporting attributed to its own view- and click-through windows, which are worth understanding before comparing anything.

  • Reconciled against the source

Sanity → Criteo · architecture

How Sanity and Criteo 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

    Criteo needs a click to match

    Criteo needs the transaction with its product IDs, quantities and values, matched to your catalogue feed. Identity resolution is Criteo's side of the problem; feed consistency is yours.

  3. 3

    The identifier is the bridge

    The Criteo user identifier and product IDs, 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

    Criteo deduplicates on the transaction identifier. Sending the same order from both a tag and a server integration without a shared ID counts it twice, and on a retargeting network that inflates the metric the whole channel is judged on.

Sanity → Criteo · normal or broken

Working vs. broken, side by side — Sanity → Criteo

Normal, not a fault

  • The Criteo user identifier and product IDs present on the conversion

  • Sent from your commerce or CRM system

  • Deduplicated correctly

    Criteo deduplicates on the transaction identifier. Sending the same order from both a tag and a server integration without a shared ID counts it twice, and on a retargeting network that inflates the metric the whole channel is judged on.

  • Reconciles with the source

Actually broken

  • The Criteo user identifier and product IDs 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

    Criteo resolves conversions against your catalogue. If the IDs in your purchase events differ from the IDs in your feed — a common outcome when the feed is generated by a different system — the conversion resolves poorly and the reported value is wrong.

  • Nobody has reconciled it

Sanity → Criteo · diagnose

Diagnostic order — Sanity → Criteo

  1. 01

    Count conversions carrying the Criteo user identifier and product IDs

  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

    Compare product IDs in a real conversion against the catalogue feed

    They must match exactly. This single check explains most Criteo value discrepancies.

  5. 05

    Read the match rate, not the success message

    Criteo reports conversions on its own attribution windows, which include view-through. Reconcile against your own order records and be explicit that view-through credit is included — otherwise the comparison will never balance.

Sanity → Criteo · prove

How it gets proven — Sanity → Criteo

Source of truth

Your commerce, CRM or billing system — Sanity has no orders and no customers.

  • The Criteo user identifier and product IDs confirmed present on a live conversion.
  • Product IDs in a live conversion confirmed to match the catalogue feed exactly.
  • The conversion confirmed sourced from the commerce system, with front-end routing verified separately.

Sanity → Criteo · free audit

What we check in the free audit

  • Count conversions carrying the Criteo user identifier and product IDs
  • Follow one real conversion end to end
  • Identify the front-end framework, not the CMS
  • Compare product IDs in a real conversion against the catalogue feed
  • 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 → Criteo · when not to buy

When you don't need this — Sanity → Criteo

  • Measure identifier coverage yourself first — pull your last hundred conversions and count how many carry the Criteo user identifier and product IDs.
  • There is no Sanity-specific build. Fix the front end and the commerce integration; the CMS is not in the path.
  • If you do not sell products with a catalogue, Criteo's model does not fit and the effort is misdirected.

Sanity → Criteo · what we deliver

What gets built — Sanity → Criteo

  • 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 Criteo

    Server-side transaction events with product IDs matching the catalogue feed, plus the feed itself kept in sync.

  • 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 → Criteo questions, answered

Only if the feed keeps the commerce system's product IDs. Build it from the commerce engine and pull content from Sanity, so IDs match the ones in your sale events.

Free · 30 min

Get Sanity and Criteo joined properly

Free30 minutesNo obligation