Basic Advertiser Tracking Guide
From Wiki
Basic Advertiser Tracking Guide
Launch Task Checklist
Component | Advertiser To do List | Notes |
---|---|---|
Tracking | Implement the tracking code onto the all confirmation pages (inclusive of Mobile Site - if applicable). Before the </body> tag. | Testing to be completed |
Implement the dwin1 Mastertag to every page of your website. Before the </body> tag. | Testing to be completed | |
Leakage | Hide all leakage from your website | AW to Check |
Commissions | Confirm commission rate for DEFAULT or other commission groups | AW to Update Interface |
Datafeed | Upload the datafeed into your account | AW to Check |
Tracking code template to be implemented
<!-- Image Pixel Tracking - Mandatory -->
<img src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant={{advertiserId}}&amount={{order_subtotal}}&cr={{currency_code}}&ref={{order_ref}}&parts=Default:{{sale_amount}}&vc={{voucher_code}}&ch=aw&testmode=0" border="0" width="0" height="0">
<!-- Product Level Tracking - Optional -->
<form style="display:none;" name="aw_basket_form">
<textarea wrap="physical" id="aw_basket">
AW:P|{{advertiserId}}|{{order_ref}}|{{product_id}}|{{product_name}}|{{unit_price}}|{{quantity}}|{{sku}}|Default|{{category}}
AW:P|{{advertiserId}}|{{order_ref}}|{{product_id}}|{{product_name}}|{{unit_price}}|{{quantity}}|{{sku}}|Default|{{category}}
AW:P|{{advertiserId}}|{{order_ref}}|{{product_id}}|{{product_name}}|{{unit_price}}|{{quantity}}|{{sku}}|Default|{{category}}
</textarea>
</form>
<!-- Javascript Tracking - Mandatory -->
<script type="text/javascript">
//<![CDATA[
/*** Do not change ***/
var AWIN = {};
AWIN.Tracking = {};
AWIN.Tracking.Sale = {};
/*** Set your transaction parameters ***/
AWIN.Tracking.Sale.amount = '{{order_subtotal}}';
AWIN.Tracking.Sale.orderRef = '{{order_ref}}';
AWIN.Tracking.Sale.parts = 'Default:{{sale_amount}}';
AWIN.Tracking.Sale.voucher = '{{voucher_code}}';
AWIN.Tracking.Sale.currency = '{{currency_code}}';
AWIN.Tracking.Sale.test = '0';
AWIN.Tracking.Sale.channel = 'aw';
//]]>
</script>
<!--Master Tag add just before the closing </body> tag-->
<script src="https://www.dwin1.com/{{advertiserId}}.js" type="text/javascript" defer="defer"></script>
Tag data
Name | Value | |
{{advertiserId}} | Must be replaced by the applicable Awin advertiser programme ID. Consult your account contact or assigned integrator if in any doubt | |
{{order_subtotal}} | Must be replaced by the total transaction amount, in most cases excluding VAT (or other taxes), delivery and discounts. 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 "If the transaction type is a lead, then instead declare the number of leads, for example: " 1 " |
|
{{currency_code}} | Populate with the ISO currency code of the currency that was used in the transaction e.g. "GBP " |
|
{{order_ref}} | Must be replaced with the unique order reference ID from your system | |
Default:{{sale_amount}} | Here {{sale_amount}} must be replaced with the price amount that falls under this commission. If only one commission group (Default) is always being used then the format is 'Default:Order_Subtotoal'. Note the colon ":" between the two values! | |
{{voucher_code}} | If a voucher code is used in the order it should be populated in this parameter | |
{{channel}} | Should be replaced with the name of the channel that is deemed as last click referrer. "aw " should always be utilised for Awin. Please refer to separate information about the Channel Parameter for more guidance |
|
{{order_ref}} | Must be replaced by the unique booking / order reference | |
testmode parameter | Should be populated with "0 " when tracking is in live mode or alternatively "1 " if in test mode. When set to the latter, the incoming tracking requests will not be processed |
|
Product Level Tracking [optional] | ||
{{product_id}} | Must be replaced with the individual product unique id from your system | |
{{product_name}} | Should be replaced with the individual product's name | |
{{unit_price}} | Must be replaced with the individual product's price. It must be consistent with how you parse the total price (NET excluding VAT or GROSS including VAT). Please also note that it should reflect deductions if a voucher code or any other promotion is used | |
{{quantity}} | Should be replaced with the quantity of the individual product in the basket | |
{{sku}} | Should be replaced with the individual prodcut's SKU code | |
{{category}} | Should be replaced with the category that the product falls under. |
[-] Commission Groups
Commission groups can be utilised to attribute the whole or parts of the transaction to a specific commission percentage or amount
Example implementations in PHP and JavaScript
PHP
<img border="0" height="0" src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=1001&amount=<?php echo $totalAmount; ?>&ch=aw&cr=<?php echo $currencyCode; ?>&parts=DEFAULT:<?php echo $totalAmount; ?>&ref=<?php echo $orderReference; ?>&testmode=0&vc=<?php echo $voucherCode; ?>" style="display: none;" width="0"> <script type="text/javascript"> //<![CDATA[ /*** Do not change ***/ var AWIN = {}; AWIN.Tracking = {}; AWIN.Tracking.Sale = {}; /*** Set your transaction parameters ***/ AWIN.Tracking.Sale.amount = "<?php echo $totalAmount; ?>"; AWIN.Tracking.Sale.channel = "aw"; AWIN.Tracking.Sale.currency = "<?php echo $currencyCode; ?>"; AWIN.Tracking.Sale.orderRef = "<?php echo $orderReference; ?>"; AWIN.Tracking.Sale.parts = "DEFAULT:<?php echo $totalAmount; ?>"; AWIN.Tracking.Sale.test = "0"; AWIN.Tracking.Sale.voucher = "<?php echo $voucherCode; ?>"; //]]> </script> <!-- Master Tag - add just before closing </body> tag on every page of the website--> <script src="https://www.dwin1.com/1001.js" type="text/javascript" defer="defer"></script>
Javascript
<script type="text/javascript"> /* * Implementing the Image Pixel (fall-back conversion) tag in javascript */ var sProtocol = (location.protocol == "http:") ? "http" : "https"; var awPixel = new Image(0, 0); awPixel.src = sProtocol + "://www.awin1.com/sread.img?tt=ns&tv=2&merchant=1001&amount=" + parseFloat(fTotalAmount).toFixed(2) + "&ch=aw&cr=" + sCurrency + "&parts=DEFAULT:" + parseFloat(fTotalAmount).toFixed(2) + "&ref=" + sOrderReference + "&testmode=0&vc=" + sVoucherCode; /* * Here starts the javascript conversion tag * Requires the dwin1 mastertag to be on the page */ var AWIN = {}; AWIN.Tracking = {}; AWIN.Tracking.Sale = {}; AWIN.Tracking.Sale.amount = parseFloat(fTotalAmount).toFixed(2); AWIN.Tracking.Sale.channel = 'aw'; AWIN.Tracking.Sale.currency = sCurrency; AWIN.Tracking.Sale.orderRef = sOrderReference; AWIN.Tracking.Sale.parts = "DEFAULT:" + parseFloat(fTotalAmount).toFixed(2); AWIN.Tracking.Sale.test = '0'; AWIN.Tracking.Sale.voucher = sVoucherCode; </script> <!-- Master Tag - add just before closing </body> tag on every page of the website--> <script src="https://www.dwin1.com/1001.js" type="text/javascript" defer="defer"></script>
Appending the mastertag in an existing javascript
var awMastertag = document.createElement("script"); awMastertag.setAttribute("defer", "defer"); awMastertag.src = (location.protocol == "http:") ? "http" : "https" + "://www.dwin1.com/1001.js"; awMastertag.type = "text/javascript"; document.getElementsByTagName("body")[0].appendChild(awMastertag);
Successful Tracking calls
If the Conversion Tag and the Mastertag have both been implemented correctly, then tracking requests similar to the below will be made. Please make sure you can see those calls. Your integrator would be happy to help you with the testing of the tracking code.
https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=1001&amount=8.33&ref=AA000001&parts=DEFAULT:8.33&vc=&testmode=0&cr=GBP&ch=aw https://www.awin1.com/sread.php?a=1001&b=8.33&cr=GBP&c=AA000001&d=DEFAULT:8.33&vc=&t=0&ch=aw&cks=1001_1403695822_a430d81e22c9e8687f423efcf024fbaa&l=https%3A//advertiser-domain.com/confirmation.php&tv=2&tt=ia https://www.awin1.com/sread.js?a=1001&b=8.33&cr=GBP&c=AA000001&d=DEFAULT:8.33&vc=&t=0&ch=aw&cks=1001_1403695822_a430d81e22c9e8687f423efcf024fbaa&l=https%3A//advertiser-domain.com/confirmation.php&tv=2&tt=js https://www.awin1.com/basket.php?product_line=AW%3AP%7C1001%7CAA000001%7C1055404%7CFull%20Body%20Massage%7C8.33%7C1%7C1055404%7CDEFAULT%7CPampering https://www.dwin1.com/1001.js