Product-level tracking enables an advertiser to produce much more in-depth reporting where the performance of individual products can easily be measured.
From an implementation perspective, as long as you are already utilizing the MasterTag, it’s as simple as adding a hidden HTML form element to the confirmation page that contains individual rows in a specific format outlining which products are included in the order.
Note
The declaration of product-level tracking must be done before the MasterTag loads.
The basket parameter values must not contain pipes, as those are used as delimiter.
Templates
Template part 1 - Start of PLT declaration
<form style="display:none;" name="aw_basket_form">
<textarea wrap="physical" id="aw_basket">Template part 2 - Product row
AW:P|{{advertiserId}}|{{orderReference}}|{{productId}}|{{productName}}|{{productItemPrice}}|{{productQuantity}}|{{productSku}}|{{commissionGroupCode}}|{{productCategory}}{{advertiserId}}must be replaced by the applicable Awin advertiser program ID. Consult your account contact or assigned integrator if in any doubt.{{orderReference}}must be replaced by the unique booking / order reference.{{productId}}must be replaced by the applicable product ID (which must be unique).{{productName}}must be replaced by the applicable product name.{{productItemPrice}}must be replaced by the price for a single quantity of this product. This ‘single unit’ price must reflect the price after any relevant discount is applied but prior to any taxes or additional charges are applied. The value must be a float, no thousand separator is allowed and finally the decimal place has to be a standard dot character, for example: 1083.29.{{productQuantity}}must be replaced by the number of the unique product purchased in the same order, for example: 1.{{productSku}}is optional but can be used to record the product’s SKU, otherwise leave it blank.{{commissionGroupCode}}must be replaced by the commission group code the product in question belongs to, which additionally has to match the breakdown you will have declared inAWIN.Tracking.Sale.parts. If you don’t map products to specific commission groups, or you’re an Awin Access customer, then populate with a static DEFAULT.{{productCategory}}is optional but can be used to record the category the product belongs to, otherwise leave it blank.
Important
Each product row must be terminated by a line break, more specifically
\r\n.Product-level tracking does not support Latin1 (ISO-8859-1) characters.
URL-encoding is needed for parameter values like
orderReference,productId,productName,productSku,productCategory,customParameter.
Template part 3 - End of PLT declaration
</textarea>
</form>Examples
Example 1 - HTML form elements
<form style="display:none;" name="aw_basket_form">
<textarea wrap="physical" id="aw_basket">
AW:P|1001|AA000006|B000EMSUQA|The Knife – Silent Shout|5.55|2|B000EMSUQA|CD|Electronic Music
AW:P|1001|AA000006|B001N2Z41Y|Sigur Ros - Heima|14.99|1|B001N2Z41Y|DVD|Music DVD
</textarea>
</form>Example 2 - JavaScript append
// 1. Example Data (e.g., from a shopping cart object)
const aw_advertiserId = '1001'; // replace with your Awin advertiser programme ID
const aw_orderReference = 'AA000006'; // replace with your onlineshop unique purchase orderid
const aw_basket = [
{ id: 'B000EMSUQA', name: 'The Knife – Silent Shout', price: '5.55', qty: 2, sku: 'B000EMSUQA', group: 'CD', cat: 'Electronic Music' },
{ id: 'B001N2Z41Y', name: 'Sigur Ros - Heima', price: '14.99', qty: 1, sku: 'B001N2Z41Y', group: 'DVD', cat: 'Music DVD' }
];
// 2. Creation of the sProductData string
let aw_sProductData = '';
aw_basket.forEach(item => {
// [Deduction]: Since pipes serve as delimiters, they must be removed from the values or encoded.
// In addition, according to the documentation, values must be URL-encoded.
const aw_basket_row = [
'AW:P',
aw_advertiserId,
encodeURIComponent(aw_orderReference),
encodeURIComponent(item.id),
encodeURIComponent(item.name),
item.price,
item.qty,
encodeURIComponent(item.sku),
item.group,
encodeURIComponent(item.cat)
].join('|');
// Each line must end with \r\n.
aw_sProductData += aw_basket_row + '\r\n';
});
const awProductsForm = document.createElement("form");
awProductsForm.name = "aw_basket_form";
awProductsForm.setAttribute("style", "display: none;");
document.getElementsByTagName("body")[0].appendChild(awProductsForm);
const awProductsTextArea = document.createElement("textarea");
awProductsTextArea.id = "aw_basket";
awProductsTextArea.wrap = "physical";
/*** sProductData in this example contains the correctly formatted product lines ***/
awProductsTextArea.value = aw_sProductData;
/*** Each line must be terminated by a line break, more specifically "\r\n" ***/
document.aw_basket_form.appendChild(awProductsTextArea);Example requests
If product-level tracking, as well as the conversion tag and the MasterTag, all have been implemented correctly then tracking requests similar to the below will be made.
https://www.awin1.com/basket.php?product_line=AW%3AP%7C1001%7CAA000006%7CB000EMSUQA%7CThe%20Knife%20-%20Silent%20Shout%7C5.55%7C2%7CB000EMSUQA%7CCD%7CElectronic%20Music
https://www.awin1.com/basket.php?product_line=AW%3AP%7C1001%7CAA000006%7CB001N2Z41Y%7CSigur%20Ros%20-%20Heima%7C14.99%7C1%7CB001N2Z41Y%7CDVD%7CMusic%20DVDNote
Depending on your advertiser program’s set up, you could see tracking requests being directed towards our alternative tracking domain
zenaps.com.
PLT for conversion pixel and S2S
Important
The Image pixel will break on character lengths longer than ~7500 so this version must no be used for extra-huge basket sizes with long product names. In general ~ 40-60 products should be fine, depending on article name and description length. You should save characters by URL-encoding just the array values, but not the array separator pipe. Pixels with a http header size bigger 8 kb will be rejected.
As an alternative, for conversion pixels (S2S and fallback, refer to the topic Fall-back conversion pixel), it’s possible to declare product-level tracking within the pixel’s URL request string.
Do this by populating each ‘product row’ of above HTML basket form as an entry to the array bd. Each product needs to be transmitted as one single GET query parameter. The parameter names are &bd[0]=&bd[1]=&bd[2]=&bd[3]=... .
The array - which will be the parameter value - must be URL encoded. The separator pipes inside the single parameter value may be encoded, but also can be left unencoded to avoid reaching the character limit.
Examples
&bd[0]=AW:P|advertiserId|orderref_encoded|productid_encoded...
&bd[0]=AW%3AP%7CadvertiserId_encoded%7Corderref_encoded%7Cproductid_encoded...
Template - Fall-back conversion pixel and S2S
&bd[0]=AW:P|{{advertiserId}}|{{orderReference}}|{{productId}}|{{productName}}|{{productItemPrice}}|{{productQuantity}}|{{productSku}}|{{commissionGroupCode}}|{{productCategory}}&p1={{customParameter1}}&p2={{customParameter2}}Non-numerical values must be URL-encoded, or the whole array (~query parameter value) must be URL encoded.
&bd[0]=is an array and should be sequential for extra products. e.g. &bd[0], &bd[1], &bd[2].{{advertiserId}}must be replaced by the applicable Awin advertiser program ID. Consult your account contact or assigned integrator if in any doubt.{{orderReference}}must be replaced by the unique booking / order reference. The parameter value has to be URL-encoded.{{productId}}must be replaced by the applicable product ID (which must be unique). The parameter value has to be URL-encoded.{{productName}}must be replaced by the applicable product name. The parameter value has to be URL-encoded.{{productItemPrice}}must be replaced by the price for a single quantity of this product. This ‘single unit’ price must reflect the price after any relevant discount is applied but prior to any taxes or additional charges are applied. The value must be a float, no thousand separator is allowed, and finally the decimal place has to be a standard dot character, for example: 1083.29.{{productQuantity}}must be replaced by the number of the unique product purchased in the same order, for example: 1.{{productSku}}is optional but can be used to record the product’s SKU, otherwise leave it blank. The parameter value has to be URL-encoded.{{commissionGroupCode}}must be replaced by the commission group code the product in question belongs to, which additionally has to match the breakdown you will have declared inAWIN.Tracking.Sale.parts. If you don’t map products to specific commission groups, or you’re an Awin Access customer, then just populate with a static DEFAULT.{{productCategory}}is optional but can be used to record the category the product belongs to, otherwise leave it blank. The parameter value has to be URL-encoded.{{customParameter1}}should be replaced by the first value to be associated with the transaction in question. The parameter value has to be URL-encoded.{{customParameter2}}should be replaced by the second value to be associated with the transaction in question. The parameter value has to be URL-encoded.
Example multiple products
&bd[0]=AW:P|{{advertiserId}}|{{orderReference}}|{{productId}}|{{productName}}|{{productItemPrice}}|{{productQuantity}}|{{productSku}}|{{commissionGroupCode}}|{{productCategory}}&bd[1]=AW:P|{{advertiserId}}|{{orderReference}}|{{productId}}|{{productName}}|{{productItemPrice}}|{{productQuantity}}|{{productSku}}|{{commissionGroupCode}}|{{productCategory}}&bd[2]=AW:P|{{advertiserId}}|{{orderReference}}|{{productId}}|{{productName}}|{{productItemPrice}}|{{productQuantity}}|{{productSku}}|{{commissionGroupCode}}|{{productCategory}}&p1={{customParameter1}}&p2={{customParameter2}}Example
<img border="0" height="0" src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=1001&amount=26.09&ch=aw&parts=CD:11.10|DVD:14.99&ref=AA000006&testmode=0&bd[0]=AW:P|1001|AA000006|B000EMSUQA|The Knife – Silent Shout|5.55|2|B000EMSUQA|CD|Electronic Music&bd[1]=AW:P|1001|AA000006|B001N2Z41Y|Sigur Ros - Heima|14.99|1|B001N2Z41Y|DVD|Music DVD" style="display:none;" width="0">Note
Pipes are forbidden characters inside the values of
orderReference,productId,productName,productSku,productCategory.