Awin
Server-to-server Awin conversion tracking. The tracking-awin app reports a sale when an order is confirmed, so affiliate conversions are recorded without relying on a browser tag.
How it works
OnOrderConfirmedobserves orders and, on thenot confirmed → confirmedtransition, schedules the reactor with the order number.awin.sale.createloads the order and, only if it carries an Awin click value, sends a GET to Awin'ssread.phpendpoint.
Attribution: the Awin click value
Awin appends awc=… to the storefront landing URL when a shopper arrives through an affiliate link. The storefront captures and stamps it; Commerce forwards it onto the order:
| Meaning | Order field |
|---|---|
| Awin click value | cart:tracking:awc |
An order without an awc did not originate from an Awin affiliate link, so no sale is reported for it.
Capture it on the landing page
awc only appears on the first page view of the affiliate visit. Store it (for example in session storage) as soon as the shopper lands, and stamp it once a cart exists.
Per-channel and per-country advertiser
The advertiser id — and optionally the commission group — resolves from the order's channel and billing country, so one tenant can route each storefront channel, and each country within it, to its own Awin advertiser account.
Both are configured in the Channel editor, under the collapsible "Awin conversion tracking" section: at the channel level, and per country.
Resolution order, most specific first:
- Country override —
awinAdvertiserIdonchannels/{channelKey}/countries/{cc} - Channel value —
awinAdvertiserIdon the channel - Global default — the
advertiserIdapp setting
commissionGroup resolves the same way, finally falling back to DEFAULT. The country used is the order's invoice recipient country.
If no advertiser id resolves for an order, it is not tracked — the reactor skips it quietly.
The sale request
The sale is reported as a single GET (tt=ss normal sale, ch=aw Awin channel):
https://www.awin1.com/sread.php
?tt=ss
&tv=2
&merchant={advertiserId}
&amount={amount}
&ch=aw
&parts={commissionGroup}:{amount}
&vc={voucher}
&cr={currencyCode}
&ref={orderNumber}
&testmode={0|1}
&cks={awc}- amount is the goods value excl. tax and excl. shipping, rounded to two decimals. Tax-inclusive orders have their tax stripped; net shipping is then subtracted per delivery.
- parts assigns the full amount to a single commission group.
- vc is the first
commerce_couponCodesvalue, if any. - ref is the order number — Awin de-duplicates on it.
Settings
| Setting | Description |
|---|---|
enabled | Master switch. When off, the reactor does nothing. |
advertiserId | Default Awin advertiser (merchant) id, used when a channel or country has no override. |
commissionGroup | Default commission group code for parts (default DEFAULT). Overridable per channel and country. |
testMode | When on, sends testmode=1 so the sale is excluded from reporting. |
Verifying
Enable testMode and schedule the reactor for a known order number that carries cart:tracking:awc. The sale then shows up in Awin's interface as a test transaction.
See Also
- Conversion Tracking — the app family and shared conventions
- Storefront Integration — capturing
awc - Cart Dynamic Fields — how the id reaches the order