Connecting Drupal Commerce to Awin
Drupal Commerce is self-hosted commerce inside a CMS built for complex content, which means the store is one part of a much larger site you fully control. 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 Drupal Commerce order 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
Drupal Commerce to Awin: keep awc past the reverse proxy
Make sure Varnish or your CDN does not strip the awc parameter, or capture it into a first-party cookie, then copy it onto the Drupal Commerce order. Post conversions server-to-server from the order placement hook with the order number, amount excluding tax and shipping, and commission group. Use the dedup field and decline cancellations.
Awin's click reference arrives as the awc parameter on the landing URL, and on many Drupal sites the edge layer is configured to strip or ignore marketing parameters so cached pages stay cached. If Varnish or the CDN drops awc before the request reaches Drupal, server-side capture sees nothing. Either exempt awc from that normalization or read it in the browser and write it to a first-party cookie, then copy it onto the order as a field once a cart exists.
Post the conversion server-to-server from the order placement hook with the click reference, the Drupal order number as the order reference, the amount and the commission group. Commission groups map naturally to product types or product variation attributes in Drupal, so define the mapping once in code rather than per campaign. Leave tax and shipping adjustments out of the commissionable amount unless your agreement says otherwise.
Use the dedup channel field. If the last paid click before the order came from Google or Meta, tell Awin, so voucher sites that intercepted at checkout do not take commission on a sale you had already paid to acquire. Cancelled and refunded orders should be amended or declined in Awin during validation, before transactions lock; Drupal's state transition to canceled is the trigger.
Drupal Commerce → Awin · what breaks
Why this join usually fails — Drupal Commerce → Awin
- 01
The Awin click reference, awc never reaches Drupal Commerce
Drupal's internal page cache and any reverse proxy in front of it serve stored renders, so anything relying on dynamically rendered values fails intermittently. Multilingual and multi-site installs add further paths where the capture code may simply not run.
- 02
Configurable workflow states nobody agreed on
Drupal Commerce lets each install define its own order states. Two people reporting on the same store routinely count different states and never reconcile.
- 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.
- 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.
Drupal Commerce → Awin · the fix
What working looks like — Drupal Commerce → Awin
The Awin click reference, awc on every order
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
Drupal Commerce → Awin · architecture
How Drupal Commerce and Awin actually connect
- 1
Drupal Commerce holds the truth
You own the database, so the truth is exactly as good as the query. Pin down which order states count as revenue before comparing anything — Drupal's workflow states are configurable per install, so no two sites agree by default.
- 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
The identifier is the bridge
The Awin click reference, awc, captured at the visit and carried into the Drupal Commerce order.
- 4
The event source decides reliability
Fire server-side from the hook rather than the checkout completion template, which is cacheable and may not execute anything.
- 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.
Drupal Commerce → Awin · normal or broken
Working vs. broken, side by side — Drupal Commerce → Awin
Normal, not a fault
The Awin click reference, awc present on the order
Sent from the Drupal Commerce order placement hook
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
Drupal's internal page cache and any reverse proxy in front of it serve stored renders, so anything relying on dynamically rendered values fails intermittently. Multilingual and multi-site installs add further paths where the capture code may simply not run.
Sent from the browser
Drupal Commerce lets each install define its own order states. Two people reporting on the same store routinely count different states and never reconcile.
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
Drupal Commerce → Awin · diagnose
Diagnostic order — Drupal Commerce → Awin
- 01
Count orders carrying the Awin click reference, awc
- 02
Follow one real conversion end to end
- 03
List the order states in use and agree which count as revenue
Do this before any technical work — it resolves more Drupal Commerce disputes than any code change.
- 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.
- 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.
Drupal Commerce → Awin · prove
How it gets proven — Drupal Commerce → Awin
Source of truth
Drupal's commerce_order records in your own database, filtered to completed states.
- The Awin click reference, awc confirmed present on a live order.
- Validated sales reconciled per order reference against your own records, with voucher-sourced sales identified and the paid-media overlap stated.
- Order field data confirmed populated on an order placed through a fully warmed cache as an anonymous visitor.
Drupal Commerce → Awin · free audit
What we check in the free audit
- Count orders carrying the Awin click reference, awc
- Follow one real conversion end to end
- List the order states in use and agree which count as revenue
- Segment publishers by type and check where the click happened in the journey
- Read the match rate, not the success message
Checked against
Drupal's commerce_order records in your own database, filtered to completed states.
Free30 minutesNo obligation
Drupal Commerce → Awin · when not to buy
When you don't need this — Drupal Commerce → Awin
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the Awin click reference, awc.
- If your Drupal site is content-only with commerce elsewhere, work at the commerce system instead — this is the wrong layer.
- 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.
Drupal Commerce → Awin · what we deliver
What gets built — Drupal Commerce → Awin
Identifier capture into Drupal Commerce
Capture the identifier and persist it as order field data through a hook on order placement, server-side, so it never depends on what the cache served.
Event source: the Drupal Commerce order placement hook
Fire server-side from the hook rather than the checkout completion template, which is cacheable and may not execute anything.
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
Order state transitions to refunded or cancelled are recorded and can drive reversals.
Written guarantee
95%+ tracking accuracy
Measured against Drupal's commerce_order records in your own database, filtered to completed states.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Drupal Commerce → Awin questions, answered
Often the CDN or Varnish strips the awc parameter before Drupal sees it, or the cached page never ran the capture code. Exempt awc from query normalization or capture it in the browser.
Decline or amend the transaction in Awin during the validation period, triggered by the order moving to canceled or the payment being refunded in Drupal.
Almost always because the Awin click reference, awc never reached the Drupal Commerce order. Drupal's internal page cache and any reverse proxy in front of it serve stored renders, so anything relying on dynamically rendered values fails intermittently. Multilingual and multi-site installs add further paths where the capture code may simply not run. Measure coverage before debugging the dispatch.
Awin sets the awc parameter on the landing URL and stores it in a cookie for the attribution window. Because attribution is last-click, that cookie being overwritten late in the journey transfers the commission — which is exactly what a voucher-code extension does at the checkout page.
The Drupal Commerce order placement hook. Fire server-side from the hook rather than the checkout completion template, which is cacheable and may not execute anything.
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.
More on Drupal Commerce → Awin
- Drupal Commerce → Google AdsConnecting Drupal Commerce to Google Ads
- Drupal Commerce → MetaConnecting Drupal Commerce to Meta Conversions API
- Drupal Commerce → GA4Connecting Drupal Commerce to GA4
RELATED GUIDES
Where Drupal Commerce → Awin fits in the rest of your tracking
- Sitecore → AwinConnecting Sitecore to Awin
- Sanity → AwinConnecting Sanity to Awin
- Concrete CMS → AwinConnecting Concrete CMS to Awin
- Drupal Commerce → PartnerStackConnecting Drupal Commerce to PartnerStack
- Drupal Commerce → ImpactConnecting Drupal Commerce to Impact.com
- Local servicesConversion tracking for local businesses, where most conversions bypass the website
- Contentful → AwinConnecting Contentful to Awin
- Ghost → AwinConnecting Ghost memberships to Awin
Free · 30 min
Get Drupal Commerce and Awin joined properly
Free30 minutesNo obligation
