---
title: "Implementing sales tracking"
slug: "implementing-sales-tracking"
updated: 2026-04-22T16:42:51Z
published: 2026-04-22T16:42:51Z
canonical: "help.awin.com/implementing-sales-tracking"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://help.awin.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Implementing sales tracking
If we do not support your [e-commerce platform](/developers/docs/ecomm-platforms) follow the below guide to implement the [Awin tracking code](/developers/docs/tracking-overview-1).
Awin uses [hybrid tracking](https://resources.awin.com/product/en-gb-hybrid-tracking/) technologies by default, meaning both [client-side](/developers/docs/client-side-tracking-1) and server-side, including the various tracking code components, such as client-side [conversion tag](/developers/docs/conversion-tag) and [conversion pixel](/developers/docs/fall-back-conversion-pixel) as well as [server-side](/developers/docs/direct-s2s) request.
We also recommend supporting [cookie signals](/developers/docs/implementing-awin-consent).
| if user accept (Awin) cookies: | if user reject (Awin) cookies: |
| --- | --- |
| ```javascript ``` | ```javascript ``` |
## MasterTag
The MasterTag is a JavaScript library containing all functions required for our tracking solution and should be unconditionally appended to every page on the site.
```javascript
```
Replace XXXXX with your Advertiser ID (AID).
Log into the platform, in the top right-hand corner of the screen you will find your AID.
## Conversion Tag
The [Conversion Tag](/developers/docs/conversion-tag), or Tracking Code as it also might be referred to, is the declaration of the `AWIN.Tracking.Sale` JavaScript object, which is done on the confirmation page to instruct the [MasterTag](/developers/docs/advertiser-mastertag) that a conversion has taken place. It will then subsequently perform the necessary tracking requests.
Place the following code onto the confirmation page (the page that appears after a customer makes a successful purchase).
```plaintext
```
Replace XXXXX with your Advertiser ID.
The text in { brackets } are placeholders (for example used in [GTM](/developers/docs/gtm-client-side)) - it will need to be replaced with the variables your shop site uses for the following information:
- {{order_total}} - The total transaction amount set to two decimal places. Can include or exclude delivery/VAT charges.
- {{currency_code}} - To be populated with the ISO currency code of the currency that was used in the transaction. Example: GBP, EUR, SEK, USD, etc.
- {{order_ref}} - A unique booking/order reference ID per order. - it could be a number you already use in your system to keep track of sales or a randomly generated number. The number must be unique as a different ID needs to be generated for each Sale. The ID is required for later recognition of the order within your own system.
- {{voucher_code}} - The coupon/voucher code used.
- > [!NOTE]
> Important
>
> This code contains values twice (from image and javascript) - please change them all. Example: {{order_ref}} or {{currency_code}}
## Final output client code example (with example values)
For example, if a customer purchases a product for £5.99 using the voucher code “HALFPRICE” the code should load as:
```xml
```
You may wish to use [PHP](https://www.php.net/manual/en/introduction.php) to load these variables (see example below). Alternatively, if you are using a third-party eCommerce platform, their support team may be able to provide you with the variables to use.
## PHP example
```php
```
## Server-side tracking
Also mandatory for our [hybrid tracking](/advertisers/docs/hybrid-tracking) is the support of at least one server side tracking request method like [Conversion API](/developers/docs/s2s-via-conversion-api) and/or over [direct integration](/developers/docs/direct-s2s) or per [Tag System](/developers/docs/tag-management-systems-2) (e.g. [GTM](/developers/docs/gtm-s2s)). In some shop or tag system the naming can be also webhook or http request or similar.
simple example for orientation in PHP:
```php
```
Note: The server-side PHP code is executed when the (purchase-/booking-)thankyou-page is requested in user browser, but is not directly visible in the client-side source code, the client browser developer console, or similar. For further examples or in other programming languages, please visit the topic-specific page for [server-side integration](/developers/docs/direct-s2s) or for the [channel](/developers/docs/channel-parameter) parameter.
To differentiate between new and existing customers, there is also the optional parameter [customer acquisition](/developers/docs/customer-acquisition). If [CommissionGroupCode](/developers/docs/commission-groups) (default value: DEFAULT inside parameter called parts) is renamed, it can also be dynamically replaced (for example with SALE, or similar), but then it must also be [set up](/advertisers/docs/commission-groups) in the [commission manager](/advertisers/docs/commission-manager). Ideally, the CommissionGroupCode description or program description (profile) contains more detailed information about the type of commission or what type of sale is meant. Typical sale use cases can include:
- purchase or booking (over web or app)
- subscription (e.g. annual or monthly fees) or
- online contract or applications (often, after approval).
## Last step - tracking tests
After integrating the Awin tracking you will need to create a test transaction via the Awin platform to check the tracking is working correctly.
Complete the steps to conduct a test transaction via our [test transaction guide](/developers/docs/testing-your-integration).
For more information on how to set up and track sales on Awin, watch our [tutorial video](https://youtu.be/XFsou4TJVpw).