Stape/Documentation

Awin Conversion API tag

Updated Oct 8, 2025

The Awin Conversion API (CAPI) tag for Google Tag Manager server-side lets you send affiliate conversion data directly to Awin’s Conversion API from your sGTM container. This ensures more accurate, consent-aware, and cookie-independent tracking while reducing reliance on client-side scripts.

The tag supports two key actions:

  • Page View: captures Awin click IDs and deduplication parameters from landing page URLs, storing them in first-party cookies for later use.
  • Conversion: sends transaction details to Awin via server-to-server postbacks, with support for commission groups, cashback flows, product-level tracking, and deduplication logic.

This setup helps advertisers track affiliate performance more reliably while maintaining compliance with privacy requirements.

Benefits of using the Awin Conversion API tag

  • Reliable affiliate attribution: server-to-server tracking bypasses browser restrictions and ad blockers, giving marketers a more accurate view of affiliate conversions.
  • Consent-aware tracking: built-in consent management ensures that cookies and tracking parameters are set only when user consent is given, supporting GDPR and CCPA compliance.
  • Reduced data loss: with click IDs and attribution data stored in first-party cookies on the server side, there’s less risk of losing critical tracking information.
  • Flexible commission setup: the tag supports multiple commission groups and product-level reporting, allowing marketers to analyze performance at a granular level.
  • Advanced features for affiliates: enhanced logging, cashback flows, and deduplication logic ensure fair attribution, cleaner data, and better optimization of affiliate campaigns.

Requirements for setting up the Awin Conversion API tag

Please ensure that you already have Google Tag Manager web and server containers, as well as a configured server container and custom domain in Stape. Please follow these guides if you don’t have any of those:

How to set up the Awin Conversion API tag

1. Configure sending data to the server GTM container. The two most popular options for sending data to sGTM are Google Analytics 4 and Data Tag/Data Client. Here is a step-by-step guide on sending data to sGTM.

2. Add the Awin Conversion API tag template in the server GTM container by importing it from the Template gallery:

  • Search for the Awin Conversion API tag by Stape in the Google Tag Manager Tag Template gallery.
  • Click Add to workspace.
Search for the Awin Conversion API tag 
Search for the Awin Conversion API tag 

3. Create the Awin Conversion API tag:

  • Go to the Tags menu → click New.
Click New in the Tags menu
Click New in the Tags menu
  • Click Tag Configuration → select Awin Conversion API.
Select Awin Conversion API
Select Awin Conversion API

4. Configure the Awin Conversion API tag

  • Event Type - select the Action you want to perform (Page View or Conversion). Most of the tag’s settings will differ depending on the Event Type. Below, we'll cover settings for both options.
Select the Action you want the tag to perform
Select the Action you want the tag to perform

Settings for the Page View event type

For these actions, the Awin CAPI tag will automatically parse URL parameters and set the necessary cookies. Make sure that this action fires on all landing pages.

  • Deduplication Channel Query Parameter Names - a.k.a Last Click Referrer Channel, it identifies where traffic originates to avoid counting the same conversion twice. It reviews URL parameters (such as source, utm_source, gclid, etc.) and the page referrer, then saves the result in the awin_source cookie. 
  • Awin Source Values - this parameter specifies all values (as a comma-separated string) that identify Awin traffic and is included as a value of the Deduplication Channel Query Parameters. Possible values include:
    • aw - assigned if an Awin-specific parameter (like "awin" or "aw") is detected in the deduplication fields, or when an Awin Click ID appears in the URL (only if this option is enabled).
    • other - used when parameters don’t match Awin values, or when identifiers like gclid or fbclid are found but not linked to Awin traffic.
    • organic - applied if the visit originates from a search engine and no paid channel identifiers are present (only if explicitly enabled).
    • direct - chosen when none of the above conditions apply.
  • Automatically treat the presence of Awin Click IDs in the URL as Awin traffic - select this option if you wish to consider the presence of awc or awaid in the URL as "Awin" in the Deduplication Channel.
  • Include Organic Traffic when determining the Last Click Referrer Channel - includes Organic Traffic when determining the Last Click Referrer Channel, only if no Awin (aw) or other (other) traffic was detected.
Required settings for the Page View event type
Required settings for the Page View event type

Optional settings:

  • Cookie Settings - set the cookie expiration (days), domain, and HttpOnly flag.
  • Cookie Consent Settings - this parameter defines how the user consent is handled for setting and reading Click ID and Last Click Referrer Channel cookies (awin_awc, awin_sn_awc, awin_source). If consent is not set / is granted, the cookies will be written and read. Otherwise, they will not.
  • Tag Execution Consent Settings - gives you an option to send data only if marketing consent is given. Should only be enabled when the web container is configured to send to the server container the consent status (e.g., via the Data Tag); otherwise, leave this option disabled to avoid tracking issues.
  • Advanced Settings (Additional Tag Metadata) - specify additional tag metadata to be included in the event data when the tag is fired.
Optional settings for the Page View event type
Optional settings for the Page View event type

Settings for the Conversion event type

  • API Key - Add the OAuth2 Token obtained on the Awin API Credentials page. Check out Awin’s guide on API authentication to learn more.
  • Use Optimistic Scenario - the tag will call gtmOnSuccess() without waiting for a response from the API. This will speed up sGTM response time. However, your tag will always return the status “fired successfully,” even if it is not.
Basic settings for the Conversion event type
Basic settings for the Conversion event type

Next, you will see a list of all possible event parameters. By default, the tag will parse all available parameters from the eventData. Some of these are required and some are optional.

  • Required parameters:
    • Merchant/Advertiser ID - ID of your advertiser account.
    • Order Reference - the transaction’s unique ID.
    • Amount - the conversion’s total value (after discounts, before additional fees such as taxes).
    • Currency Code - the conversion’s currency (must be a recognised currency code as per ISO-4217 standard, such as EUR or USD).
    • Last Click Referrer Channel - the conversion’s channel (such as aw). If you do not wish to fall back to the cookie value, pass your own value to this field. If left empty, it will be retrieved from the awin_source cookie set by this tag’s Page View event type (see the previous section of this article).
Required settings for the Conversion event type
Required settings for the Conversion event type
  • Also required is AT LEAST one of the following:
    • Voucher/Discount Code - the code or name of the voucher/discount code that was used in the conversion.
    • Awin Click ID (awin_awc and awin_sn_awc cookie value) - if left empty, these values will be automatically taken from the awin_awc or awin_sn_awc cookie. Best left unmodified unless you have a custom implementation.
    • Publisher ID and Click Time - the ID of the Publisher that generated the conversion + the timestamp of when the click that led to the conversion happened as a Unix timestamp in seconds (length: 10).
Required at least one of these settings
Required at least one of these settings
  • Optional parameters:
    • Commission Groups - defines the commission structure for the order. If left blank, the commission group DEFAULT and the Amount field, as commission group value, will be used. If a single group name (e.g., "CD"), the Amount field will be automatically used as the commission value. If a full set of groups (string or array), add the commission value for each group (e.g., "CD:11.10|DVD:14.99").
    • Basket (Product Level Tracking) - product-level data for the transaction. Must be an array of objects, each object is a product containing properties. Required properties: id or item_id; name or item_name; price; quantity. Optional properties: commissionGroupCode or commission_group_code; category or item_category; sku or item_sku.
    • Customer Acquisition - indicates if this is a new or returning customer.
    • Transaction Timestamp - the timestamp of when the conversion happened as a Unix timestamp in seconds (length: 10).
    • Test Mode - if true, the tag will fire in test mode and the reported conversion will be ignored.
    • Webhook URL - specify a webhook URL for Awin to send notifications to.
Optional parameters for the Conversion event type
Optional parameters for the Conversion event type

Other Optional settings:

  • Custom Parameters - adds any additional custom data to the request.
  • Cookie Consent Settings - this parameter defines how the user consent is handled for setting and reading Click ID and Last Click Referrer Channel cookies (awin_awc, awin_sn_awc, awin_source). If consent is not set / is granted, the cookies will be written and read. Otherwise, they will not.
  • Tag Execution Consent Settings - gives you an option to send data only if marketing consent is given. Should only be enabled when the web container is configured to send to the server container the consent status (e.g., via the Data Tag); otherwise, leave this option disabled to avoid tracking issues.
  • Logs Settings - choose if you want to log requests to your Stape account. This feature is handy when setting up server-side tagging since it allows seeing incoming and outgoing requests and network responses.
  • BigQuery Logs Settings - allows you to configure BigQuery logging.
  • Advanced Settings (Additional Tag Metadata) - specify additional tag metadata to be included in the event data when the tag is fired.
Other optional settings for the Conversion event type
Other optional settings for the Conversion event type

5. Once the tag’s configuration is completed, add a Trigger 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). Give the trigger a descriptive name, and click Save.

Add a Trigger for the tag 
Add a Trigger for the tag 

How to test and troubleshoot the Awin Conversion API tag setup

You can test the configurations in Google Tag Manager. Click on Preview, trigger the event, and check whether the tag has fired.

Testing and troubleshooting the Awin Conversion API tag 
Testing and troubleshooting the Awin Conversion API tag 

Comments

Can’t find what you are looking for?