Skip to main content
Sanity → AwinIntegration guide

Connecting Sanity to Awin

Sanity is a headless content platform, which means like every headless CMS it holds no commercial record and the tracking question lives elsewhere. Awin is a traditional last-click affiliate network, and last-click is the whole problem: whoever touched the customer most recently takes the commission, which is a structural invitation for voucher-code sites to intercept sales you had already won. The join between them succeeds or fails on one thing: whether the Awin click reference, awc reaches the front-end conversion, not a Sanity record before the conversion happens, because Awin can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Awin on a Sanity storefront: awc capture belongs in the front end

On a Sanity storefront the order lives in the commerce platform. Read awc in front-end middleware into a first-party cookie, write it onto the cart or order, and post server-to-server from commerce with order reference and value. Build Awin's product feed from commerce, not Sanity, use the dedup flag against other paid channels, and fire the MasterTag on route changes.

Sanity storefronts split content from checkout, often Sanity alongside Shopify through Sanity Connect, or a separate commerce API. The awc parameter lands on a page rendered from Sanity, but the order is created by the commerce platform, frequently on its own checkout. Read awc in the front-end app's middleware into a first-party cookie, then write it onto the cart or order so the server-to-server post comes from the commerce system with the order reference and value.

Build Awin's product feed from the commerce platform, not from Sanity. Sanity product documents carry editorial descriptions and imagery, while price and stock live in commerce. A feed assembled from Sanity alone can advertise a price checkout no longer charges, and publishers will query every order where the commission value disagrees with what they promoted.

Sanity-built buying guides and gift lists are exactly what content publishers and voucher sites rework, so expect publisher clicks late in journeys your own ads started. Record the last paid channel on the order and use Awin's dedup flag to decline commission when another channel already claimed the sale, instead of paying twice. The MasterTag goes in the front end's layout, and it must fire on client-side route changes, not just the first load.

Sanity → Awin · what breaks

Why this join usually fails — Sanity → Awin

  1. 01

    The Awin click reference, awc 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

    Voucher-code publishers intercepting sales at the checkout

    A customer arrives from a paid ad, reaches the basket, opens a new tab to search for a discount code, clicks a voucher site's link and returns to complete the order. Under last-click the voucher site earns the commission on a sale your advertising produced. This is not a fringe case; on many programmes it is the largest single publisher category.

  4. 04

    Nothing reconciles afterwards

    Awin's reporting shows the sale, the publisher and the commission group. Read the publisher type and the time between click and sale — a click seconds before the order tells you what happened.

Sanity → Awin · the fix

What working looks like — Sanity → Awin

  • The Awin click reference, awc on every conversion

  • Conversions arriving in Awin

    The sale appears as pending, publishers see it in their reporting, and it validates after your approval period.

  • Reconciled against the source

Sanity → Awin · architecture

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

    Awin needs a click to match

    Awin needs the click reference, a unique order reference, the order value and the commission group. Missing the click reference means the sale is untracked and the publisher will query it.

  3. 3

    The identifier is the bridge

    The Awin click reference, awc, 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

    Awin deduplicates on your order reference. It also supports a dedup flag so you can decline to commission sales that another channel already claimed — which is the feature most advertisers do not know exists and should be using.

Sanity → Awin · normal or broken

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

Normal, not a fault

  • The Awin click reference, awc present on the conversion

  • Sent from your commerce or CRM system

  • Deduplicated correctly

    Awin deduplicates on your order reference. It also supports a dedup flag so you can decline to commission sales that another channel already claimed — which is the feature most advertisers do not know exists and should be using.

  • Reconciles with the source

Actually broken

  • The Awin click reference, awc 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

    A customer arrives from a paid ad, reaches the basket, opens a new tab to search for a discount code, clicks a voucher site's link and returns to complete the order. Under last-click the voucher site earns the commission on a sale your advertising produced. This is not a fringe case; on many programmes it is the largest single publisher category.

  • Nobody has reconciled it

Sanity → Awin · diagnose

Diagnostic order — Sanity → Awin

  1. 01

    Count conversions carrying the Awin click reference, awc

  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

    Segment publishers by type and check where the click happened in the journey

    Voucher and cashback clicks that occur within seconds of an order are interception, not acquisition. Use the deduplication flag rather than paying for both.

  5. 05

    Read the match rate, not the success message

    Awin's reporting shows the sale, the publisher and the commission group. Read the publisher type and the time between click and sale — a click seconds before the order tells you what happened.

Sanity → Awin · prove

How it gets proven — Sanity → Awin

Source of truth

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

  • The Awin click reference, awc confirmed present on a live conversion.
  • Validated sales reconciled per order reference against your own records, with voucher-sourced sales identified and the paid-media overlap stated.
  • The conversion confirmed sourced from the commerce system, with front-end routing verified separately.

Sanity → Awin · free audit

What we check in the free audit

  • Count conversions carrying the Awin click reference, awc
  • Follow one real conversion end to end
  • Identify the front-end framework, not the CMS
  • Segment publishers by type and check where the click happened in the journey
  • 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 → Awin · when not to buy

When you don't need this — Sanity → Awin

  • Measure identifier coverage yourself first — pull your last hundred conversions and count how many carry the Awin click reference, awc.
  • There is no Sanity-specific build. Fix the front end and the commerce integration; the CMS is not in the path.
  • If you run no affiliate programme this is irrelevant. If you do, the commission structure by publisher type will change your economics more than the tracking accuracy will.

Sanity → Awin · what we deliver

What gets built — Sanity → Awin

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

    Server-to-server conversion posting from your order system, or the tracking pixel where server posting is not available.

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

In the front-end application's layout. Sanity runs no code on your pages; the framework rendering them does.

Free · 30 min

Get Sanity and Awin joined properly

Free30 minutesNo obligation