The Awin Conversion API Tag allows you to send conversion data directly from your server container to Awin's Conversion API, ensuring accurate, consent-aware, and cookie-independent tracking for affiliate conversions.
It supports both Page View events (for cookie creation) and Conversion events, with full support for deduplication logic, cashback flows, commission groups, product-level tracking, and enhanced logging.
- Page View: Captures Awin tracking parameters from the URL and saves them as cookies for later use.
- Conversion: Sends a server-to-server request (postback) with conversion data to Awin, using information from cookies or event data.
- Add the Awin Conversion API Tag to your server container in GTM.
- Select the Action you want to perform (
Page View
orConversion
). - For
Page View
actions, the tag will automatically parse URL parameters and set the necessary cookies. This action should fire on all landing pages. - For
Conversion
actions, fill in yourAdvertiser ID
,API Key
, and the required conversion parameters. - Add triggers to fire the tag based on the selected action (e.g., all page views for the "Page View" action, purchase events for the "Conversion" action).
When the action is set to Page View
, the tag's primary role is to capture attribution data from the landing page URL and store it in first-party cookies. This information is then used by the Conversion
action to correctly attribute sales.
The tag captures two key pieces of information:
-
Click IDs: It looks for Awin's click identifiers in the URL.
awc
: The standard Awin Click ID.awaid
andgclid
: Awin and Google Click IDs used together for specific tracking scenarios.- These values are stored in the
awin_awc
cookie; orawin_sn_awc
cookie, ifsn=1
is present in the URL and the Unconditional Cashback & Rewards Tracking checkbox is enabled.
-
Last Click Referrer Channel: Also known as the Deduplication Channel, this determines the source of the traffic to prevent duplicate commissions. The tag analyzes URL parameters (like
source
,utm_source
,gclid
, etc.) and the page referrer to determine the channel. The result is stored in theawin_source
cookie and can be one of the following values:aw
: Set if an Awin source value (e.g., "awin", "aw") is found in the deduplication parameters, or if an Awin Click ID is present in the URL (only if explicitly enabled).other
: Set if the deduplication parameters do not match any known Awin values, or if other tracking parameters (likegclid
,fbclid
) are found but are not identified as Awin traffic.organic
: Set if the traffic comes from a known search engine and no other paid channel parameters are present (only if explicitly enabled).direct
: Set if none of the other conditions are met.
When the action is set to Conversion
, the tag sends the final transaction data to the Awin API via a server-to-server postback.
- Advertiser ID: Your Awin Advertiser ID.
- API Key: The OAuth2 Token, found in your Awin account on the
Awin API Credentials
page. - Order Reference: A unique ID for the transaction.
- Amount: The total value of the conversion.
- Currency: The currency of the conversion.
- Channel: The channel responsible for the conversion (e.g.,
aw
). It can be retrieved from theawin_source
cookie set by the Page View action.
The tag also requires at least one of the following for attribution:
- Awin Click ID (awc)
- Voucher Code
- Publisher ID and Click Time
- Commission Groups: Defines the commission structure for the order. This can be provided in several formats:
- If left blank, the commission group
DEFAULT
and the Amount field, as commission group value, will be used. - A single group name where the Amount field is used as the commission value (e.g.,
DVD
). - A full set of groups and their respective amounts (e.g.,
CD:11.10|DVD:14.99
). - An array of objects (e.g.,
[ { "code": "CD", "amount": 11.10 }, { "code": "DVD", "amount": 14.99 } ]
).
- If left blank, the commission group
- Basket: Product-level data for the transaction. The tag can automatically use
items
from the event data. At least theid
,name
,price
and quan`tity must be provided for each product. - Customer Acquisition: A flag to indicate if this is a new customer.
- Transaction Time: The timestamp of when the conversion happened.
- Is Test: Set to true to send a test transaction.
- Custom Parameters: Add any additional custom data to the request.
- Webhook URL: Specify a webhook URL for Awin to send notifications to.
This section controls how the tag handles user consent for setting and reading attribution cookies (awin_awc
, awin_sn_awc
, awin_source
).
- Consent Detection: You can choose how the tag determines consent:
- Automatically: The tag will check for consent signals from Google Consent Mode or Stape's Data Tag.
- Manually: You can provide a custom variable that specifies the consent status (
true
/false
or1
/0
).
- Enable Unconditional Cashback & Rewards Tracking: This is a special setting for Cashbacks & Rewards Journeys. When enabled, the tag is allowed to set the necessary attribution cookie (
awin_sn_awc
) and read them (awin_sn_awc
andawin_awc
) even if the user has not given consent.
The Awin Conversion API Tag for GTM Server-Side is developed and maintained by the Stape Team under the Apache 2.0 license.