Awin Access Technical Integration Developer Guide (lead)

From Wiki

Revision as of 12:01, 6 May 2021 by Aimee Whalley (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Awin Access Tracking Implementation - Generic Developer Guide (lead)

This guide is designed for advertisers looking to track leads. If you are a sale based advertiser see the developer sale guide.

Master Tag

Place the following code on every page of the site.

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.

<!--Master Tag add just before the closing </body> tag--> 
<script src="https://www.dwin1.com/XXXXX.js" type="text/javascript" defer="defer"></script>


Replace XXXXX with your Advertiser ID (AID).

Log into the Awin UI, in the top right-hand corner of the screen you will find your AID.

Conversion Tag

The 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 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).

<!—Image Pixel - Mandatory --> 
 
<img src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=XXXXX&amount=1.00&cr=GBP&ref={{order_ref}}&parts=DEFAULT:1.00&vc=&ch=aw&testmode=0" border="0" width="0" height="0">
 
<!-- 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 = "1.00";
AWIN.Tracking.Sale.orderRef = "{{order_ref}}";
AWIN.Tracking.Sale.parts = "DEFAULT:1.00";
AWIN.Tracking.Sale.currency = "GBP";
AWIN.Tracking.Sale.test = "0";
AWIN.Tracking.Sale.channel = "aw";
//]]>
</script>

Replace the following:

  • XXXXX with your Advertiser ID
  • GBP with your local currency if you are based outside the UK (e.g. EUR, SEK).
  • {{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.

Watch out: there are two instances of GBP and {order_ref} in this code make sure to change both of them.

Server side example

Here's a server side example of how the above could be achieved using PHP:

<!—Image Pixel - Mandatory --> 
 
<img src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=MYADVERTISERID&amount=1.00&cr=GBP&ref=<?php echo microtime(true); ?>&parts=DEFAULT:1.00&vc=&ch=aw&testmode=0" border="0" width="0" height="0">
 
<!-- 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 = "1.00";
AWIN.Tracking.Sale.orderRef = "<?php echo microtime(true); ?>";
AWIN.Tracking.Sale.parts = "DEFAULT:1.00";
AWIN.Tracking.Sale.currency = "GBP";
AWIN.Tracking.Sale.test = "0";
AWIN.Tracking.Sale.channel = "aw";
//]]>
</script>

Client side example

The above PHP code would load onto the webpage as:

<!—Image Pixel - Mandatory --> 
 
<img src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=MYADVERTISERID&amount=1.00&cr=GBP&ref=1602161929.4418&parts=DEFAULT:1.00&vc=&ch=aw&testmode=0" border="0" width="0" height="0">
 
<!-- 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 = "1.00";
AWIN.Tracking.Sale.orderRef = "1602161929.4418";
AWIN.Tracking.Sale.parts = "DEFAULT:1.00";
AWIN.Tracking.Sale.currency = "GBP";
AWIN.Tracking.Sale.test = "0";
AWIN.Tracking.Sale.channel = "aw";
//]]>
</script>

Last Step - Tracking Tests

After integrating the Awin tracking you will need to create a test transaction via the Awin User Interface to check the tracking is working correctly.

Complete the steps to conduct a test transaction via our Test Transaction Guide

Return to tracking guide home page here

Privacy

Due to new European legislation regarding how websites store information about you, AWIN is updating its privacy policy. You can see the new version of our policy here. If you would like to see the information we capture on this website, please click here for further details. In order to accept cookies on this site please click the 'I ACCEPT' button