---
title: "Implementing leads tracking"
slug: "implementing-leads-tracking"
updated: 2026-04-22T16:39:42Z
published: 2026-04-22T16:39:42Z
canonical: "help.awin.com/implementing-leads-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 leads tracking
This guide is designed for advertisers looking to track leads. If you are a sale based advertiser, see the [sales tracking guide](/developers/docs/implementing-sales-tracking).
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](/developers/docs/tracking-overview-1), 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 offer plugin solutions for some [e-commerce online shop systems](/developers/docs/ecomm-platforms). We also recommend supporting [cookie signals](/developers/docs/implementing-awin-consent).
## MasterTag
The MasterTag is a JavaScript library containing all functions required for our tracking solutions and should be unconditionally appended to every page on the site.
Place the following code on every page of the site:
```javascript
```
Replace XXXXX with your Advertiser ID (AID).
Log into the Awin 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 loads after a customer makes a successful lead).
```xml
```
Replace the following:
- XXXXX with your Advertiser ID
- GBP with your local currency if you are based outside the UK (e.g. EUR, SEK, USD).
- {{order_ref}} with a variable used to generate an ID for each transaction - it could be a number you already use in your system to keep track of leads or a randomly generated number. The number must be unique as a different ID needs to be generated for each lead.
> [!NOTE]
> Important
>
> There are two instances of GBP and {order_ref} in this code - make sure to change both of them.
## Example (with dynamic data in client side code)
Here's a simple client side example of how the above could be achieved using [PHP](https://www.php.net/manual/en/introduction.php):
```php
```
## Final output client code example (with example values)
The above PHP code would load onto the webpage as:
```xml
```
## 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 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 LEAD, 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 lead is meant. Typical lead use cases can include:
- new customer registration
- new newsletter registration
- online subscription application (with fix commission for registration),
- install (e.g.: mobile app, software (on your OS), game, adware or toolbar/browser extension, etc.)
- survey,
- competition/raffle/tombola participation,
- online ordering of product sample(s),
- callback request,
- online inquiry or online contract or applications before 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 leads on Awin, watch our [tutorial video](https://youtu.be/uuSmv6aSSaI).