Merchant Tracking Guide

From Wiki

Jump to: navigation, search

Contents

Introduction

BEFORE YOU ATTEMPT TO ADD ANY TRACKING ONTO YOUR PAGES PLEASE ENSURE YOU HAVE SPOKEN TO A TECHNICAL REPRESENTATIVE.

The Affiliate Window tracking technology works using cookies (HTTP & Flash) and ETag requests to store information on the visitor’s computer. When a visitor clicks on an affiliate link information is stored about the click such as the time of the click and which affiliate referred the visitor.

The cookies and ETag request remain active until it expires. The information is then picked up by our system by the addition of our tracking code displayed on your web page. This code is used to confirm a transaction on our system, and is normally placed on the ‘thank you’ or ‘confirmation of sale’ page.This ensures we only report sales originating from Affiliate Window referred traffic.

Image:Tracking_Diagram.JPG

  1. User clicks on an affiliate website
  2. The affiliate website redirects traffic through Affiliate Window. At this stage Affiliate Window creates a cookie (HTTP & Flash cookie) and triggers an ETag request, which stores vital information regarding the click & affiliate.
  3. Affiliate Window will redirect the user through to the destination URL which is either set by Affiliate Window (default click through) or the affiliate (deeplink). At the destination page a small tracking tag is fired which fires the cookies to be stored on merchant domain. This small tracking tag should also be present on all other pages and is normally inserted into the Template version of the site
  4. At the confirmation page the sales tracking tag is shown, which contains relevant order information.
  5. The details are sent to Affiliate Window (by showing the tracking tag). Affiliate Window will then marry this information up with the affiliate cookie.

NOTE: If you operate several payment methods (Paypal, Bank/Cheque, Worldpay) with different confirmation pages, the tracking tag will also need to be copied across to those confirmation pages.

Flash Cookies

This involves the creation and storage of flash cookies in a browser. This type of cookie has the functionality of a regular HTTP 1st party cookie (e.g. uses merchants domain), and will contain the merchant ID, timestamp and unique hash. The major benefit with Flash cookies is that they are stored in a different location to normal text cookies and cannot be deleted by the browser. This means that Flash Cookies are less likely to be deleted and so may still be present for sales where the user has already deleted their normal cookies.

Our tracking tag will detect whether a browser has Flash installed and if so, which version. It will not try to create the cookie if Flash is not installed or if the installed version is too old and does not support Flash cookies. This detection prevents the browser opening a pop up window requesting the user to install or upgrade the Flash player and so keeps our tracking completely transparent.

A variety of options existing in Settings Manager include, disabling Flash cookies, deleting or changing the storage size. Adobe does not have access to these settings or the information stored on the users browser.

ETag Tracking

An ETag is a HTTP header response returned by a web server to determine if the content of a URL has changed. We are manipulating this functionality to find out on the confirmation page if a user has arrived via an Affiliate Window link.

On click through an image request will be made if the ‘awc’ parameter is seen. Our server will respond with an ETag containing the merchant ID, timestamp and unique hash, which is stored in the browsers cache. On the confirmation page, our server will request the ETag and identify the sale as Affiliate Window if we can match up the data to what we logged on the initial click.

The ETag data is stored in the browsers cache and remains separate from the text cookies and Flash cookie. This further increases our chance to identify a sale correctly as a user would need to completely clear their browser cache to make this option redundant

Activation

At this stage, you will have to be specifically enabled for the tracking code to work, so please contact Technical Services before trying to implement it. After being enabled, all the redirects from AWIN to your site will contain the additional “awc” parameter.

 http://www.yoursite.com/shop.php?awc=1257_1211301146_9990c87ad38e2759b8ed78c0e40

If you are using URL rewriting on your site, you will need to ensure that your rewrite rules are compatible with the new tracking. We find this is commonly used for custom landing pages where you might provide the affiliate with a URL similar in format to the following…

This redirects to…

 http://www.yoursite.com/index.php?partner=affiliatename

You will need to ensure that the query string is passed through the redirection, so…


 http://www.yoursite.com/affiliatename?awc=1257_1211301146_9990c87ad38e2759b8ed78c0e40

Will redirect to…

 http://www.yoursite.com/index.php?partner=affiliatename&awc=1257_1211301146_9990c87ad38e2759b8ed78c0e40/affiliatename?awc=1257_1211301146_9990c87ad38e2759b8ed78c0e40

Implementing the Tracking

There are two sections of tracking code which you will need to implement. Firstly the master tag needs to be added to all pages, this is used to track via 1st party cookies, etags, flash cookies and will allow you to include 3rd party tracking. Secondly you will need to add the tracking tag for sales purposes onto your confirmation page.

All pages

Insert the following line just before the closing </BODY> tag, on each page of your site: (Please keep as a single line) Replace the MERCHANT_ID placeholder, with your own AWIN merchant id.

 <script src="https://www.dwin1.com/MERCHANT_ID.js" type="text/javascript" defer="defer"></script>

Confirmation page

You will then be required to add the sales tracking tag onto the “confirmation page” of your site:

 
<img src="https://www.awin1.com/sread.img?tt=ns&amp;tv=2&amp;merchant=MERCHANT_ID&amp;amount=SALE_AMOUNT&amp;ref=ORDER_REF&amp;parts=COMMISSION_GROUP:SALE_AMOUNT&amp;vc=VOUCHER_CODE&amp;testmode=1&amp;cr=GBP" />
 
<form style="display:none;" name="aw_basket_form">
 <textarea wrap="physical" id="aw_basket">
AW:P|merchant_id|order_ref|product_id|product_name|unit_price|quantity|sku_data|cg|category
AW:P|merchant_id|order_ref|product_id|product_name|unit_price|quantity|sku_data|cg|category
AW:P|merchant_id|order_ref|product_id|product_name|unit_price|quantity|sku_data|cg|category
</textarea>
</form>
 
<script type="text/javascript">
 //<![CDATA[
    /*** Do not change ***/
    var AWIN = {};
    AWIN.Tracking = {};
    AWIN.Tracking.Sale = {};
 
    /*** Set your transaction parameters ***/
    AWIN.Tracking.Sale.amount = 'SALE_AMOUNT';
    AWIN.Tracking.Sale.currency = 'GBP';
    AWIN.Tracking.Sale.orderRef = 'ORDER_REF';
    AWIN.Tracking.Sale.parts = 'COMMISSION_GROUP:SALE_AMOUNT';
    AWIN.Tracking.Sale.voucher = 'VOUCHER_CODE';
    AWIN.Tracking.Sale.test = '1';
 //]]>
</script>
 
<script src="https://www.dwin1.com/_MID_.js" type="text/javascript" defer="defer"> </script>


Please follow the instructions below to continue integrating and for further clarification on all elements.

Currency Conversion

If your website tracks sale values in currencies other than GBP, you must identify and pass the currency code into the currency variable found in the JavaScript and image pixel. Affiliate Window will convert the sale value to GBP and display the new value in the merchant and affiliate interface. Currency rates are updated hourly to ensure the most up to date conversion is possible at the time of processing.

Our system will treat the sale value as GBP if you send a currency code we do not recognise.

Please view here for a list of currencies that Affiliate Window support.


Mobile M Commerce integration

With mobile devices becoming ever more popular, and with the growth of technology and consumers now shopping via mobile devices - more and more merchants are now starting to use m commerce websites. If you have an m commerce website and would like to integrate the tracking code, simply follow the same principles as above. The tracking code should be placed on to the confirmation of sale page and you may also place the master tag on all pages.

Once you have completed this, it's vital you let your technical contact know so that they can begin testing.


Standard Tracking Integration

The standard tracking code needs to be added to the ‘thank you’ or ‘confirmation of sale’ page on your site. Passed in to this code are your merchant ID and other variables.

On the final page of this document you will find the full Javascript tracking code example. Below are excerpts from this code that you will need to add information to. These are the only parts of the code that you need to parse in values.


Image Pixel Tracking Code (back-up to the Javascript):

 <img src=https://www.awin1.com/sread.img?tt=ns&amp;tv=2&amp;merchant=MERCHANT_ID&amp;amount=SALE_AMOUNT&amp;ref=ORDER_REF&amp;parts=COMMISSION_GROUP:SALE_AMOUNT&amp;vc=VOUCHER_CODE&amp;testmode=1&amp;cr=GBP />


Product Level Tracking Code:

 <form style="display:none;" name="aw_basket_form">
 <textarea wrap="physical" id="aw_basket">
AW:P|merchant_id|order_ref|product_id|product_name|unit_price|quantity|sku_data|cg|category
AW:P|merchant_id|order_ref|product_id|product_name|unit_price|quantity|sku_data|cg|category
AW:P|merchant_id|order_ref|product_id|product_name|unit_price|quantity|sku_data|cg|category
 </textarea>
 </form>

Javascript Tracking Code:

 <script type="text/javascript">
 //<![CDATA[
    /*** Do not change ***/
    var AWIN = {};
    AWIN.Tracking = {};
    AWIN.Tracking.Sale = {};
 
    /*** Set your transaction parameters ***/
    AWIN.Tracking.Sale.amount = 'SALE_AMOUNT';
    AWIN.Tracking.Sale.currency = 'GBP';
    AWIN.Tracking.Sale.orderRef = 'ORDER_REF';
    AWIN.Tracking.Sale.parts = 'COMMISSION_GROUP:SALE_AMOUNT';
    AWIN.Tracking.Sale.voucher = 'VOUCHER_CODE';
    AWIN.Tracking.Sale.test = '1';
 //]]>
 </script>
 <script src="https://www.dwin1.com/_MID_.js" type="text/javascript" defer="defer">  </script>

Explanation of the Parameter Values

Javascript & Image Pixel tracking code variables

Variable Description
MERCHANT_ID Replace this with your Affiliate Window merchant id.
TOTAL_SALE_VALUE Replace this with the transaction value (without £ sign). This should be the variable in your shopping cart software representing the order amount. Our software will calculate the commission based on this amount. If you are paying a set amount per transaction then you can pass us:

AWIN.Tracking.Sale.amount = '1.00';

CUSTOMER_ORDER_REFERENCE Replace this with the order reference for the transaction from your system. This will help identify that the commission is legitimate. Make sure this is a unique reference, for instance an order number or a registration number. This should be the variable in your shopping cart representing the order reference number.
COMMISSION_GROUP:SALE_VALUE The parts information is used when offering commission groups/structure. If you are not using commission groups then pass us in the parts parameter 'default:amount' where 'amount' is the value of the transaction in the 'sale' parameter.
0 Add ‘1’ if you are testing the tracking code alongside other Affiliate Window tracking code. When you are happy that the code is correct and tracking correctly this can be changed to ‘0’.
VOUCHER_CODE The voucher or discount code used at purchase can be parsed in to the tracking code. This allows you to see the voucher codes that affiliates are using to promote.

Product Level Tracking Variables

Variable Description
PRODUCT_ID The merchant’s unique ID for this specific product
PRODUCT_NAME The merchant’s product name for this specific product
UNIT_PRICE The merchant’s price of that product
QUANTITY This is the quantity of this product that has been ordered within this transaction
SKU_DATA Add in the SKU/MPN or EAN of this product into this area of the product level tracking. This needs to be unique per product. (NB This parameter is optional)
CG Add the Commission group in which this ties into for AW system. This could be DEFAULT/CDs or DVDs depending on how you’ve setup the commission groups here at AW.
CATEGORY This is the category in which the product is categorised on the merchant site. (NB This parameter is optional)

Commission Groups Integration

The Commission Groups feature offers extra functionality to merchants who wish to have precise control over their commission levels.

  • Allows a merchant to offer variable rates of commission on different groups of products in their product range.
  • Allows the introduction of performance-based criteria per product, to give an incentive to affiliates to promote a certain sector of your business.
  • The ability to add recurring bonuses for affiliates.
  • Ability to add ‘private’ commissions for top performing affiliates.
  • Ability for the system to automatically increase affiliates daily, to the next level when they achieve the set target.

Recording Product Groups

Depending on how you define your groups, your database will need to be amended so that it holds a record of the mappings between your products or categories and the product groups you have defined within our system. If there is a direct correlation between your product categories and product groups then this process will be fairly simple. Once product groups have been decided upon, these need to be added to your systems and mappings applied.

Referencing Product Groups

Your sales confirmation page will need to be able to determine the product group for each product contained in the customers shopping cart (if one has been assigned). This information can either be retrieved from your database by your sales confirmation page or retrieved as the customer shops, and stored in the cart. The important thing here is that the confirmation page has access to this product group information.

Transmitting Product Groups

Please refer to section 3 of this document for instructions on adding the tracking code. In addition to section 3 the following must be added in to the tracking code.

Your sales confirmation page will need to calculate totals for each group that has contributed to the shopping cart. This data will then need to be concatenated to form the value to be sent in the ‘parts’ parameter, i.e.:

 'DEFAULT:9.75|CD:22.34|DVD:46.98'

Noscript If the sale comprises of more than one group, then the group/value pairs must be separated by a pipe character ‘|’.

The parts value then needs to be placed in the Javascript tracking code and the pixel tracking code like below:

Javascript Tracking Code:

 AWIN.Tracking.Sale.parts = 'DEFAULT:9.75|CD:22.34|DVD:46.98';

Noscript Tracking Code:


 <img src=https://www.awin1.com/sread.img?tt=ns&amp;tv=2&amp;merchant=MERCHANT_ID&amp;amount=SALE_AMOUNT&amp;ref=ORDER_REF&amp;parts=DEFAULT:9.75|CD:22.34|DVD:46.98&amp;vc=VOUCHER_CODE&amp;testmode=1&amp;cr=GBP />

The value of the ‘parts’ parameter is specified as the group code followed by a colon ‘:’ followed by the value of the goods sold in that group.

For example, if a customer has purchased £100 of goods comprising of £50 of DVDs and £50 of Videos then the following would be used to call the logging script image;

Javascript tracking code:

AWIN.Tracking.Sale.parts = 'dvd:50.00|video:50.00';

Noscript tracking code:

 <img src=https://www.awin1.com/sread.img?tt=ns&amp;tv=2&amp;merchant=MERCHANT_ID&amp;amount=100.00&amp;ref=ORDER_REF&amp;parts=DVD:50.00|VIDIO:50.00&amp;vc=VOUCHER_CODE&amp;testmode=1&cr=GBP />


For commission to be calculated correctly for this transaction the Commission Group codes ‘dvd’ and ‘video’, must have been created within your merchant account.

The total sale amount being parsed in the ‘sale’ variable should add up to the total of the parts. If it is not, the commission group sales will be ignored and commission will be applied at the default rate.

Note: The tracking code must send Affiliate Window the sale amount in Pounds Sterling.

Note: This section is a brief guide to integrating commission structure. If you need information on the functionality and how to use the system then please request the ‘Commission Structure Guide’ from the support team, your contact or documentation available in your merchant account.

Please see the examples pages at the end of this document for an example of the full tracking code for a commission group sale.

Click Append

Note: Enabling the tracking code to only display when the visitor has been referred by an AW affiliate.

Affiliate Window has the technology to pass a value to the end of any URL an affiliate uses to send traffic through to a merchants website. This is called a ClickAppend. The ClickAppend can be used by the merchant in several different ways. For example:

  • To track that a sale has come through from Affiliate Window and tag it so the merchant knows where the sale has come from.
  • To enable the AW tracking code to only display when an AW affiliate has referrer the customer. This is useful if a merchant is using multiple Affiliate Networks. This system will reduce the possibility of sales being tracked by the other networks involved as well as AW. This is dependant on the other networks putting a similar solution in place.

Please also see the Merchant Click Append Guide for more information regarding this aspect.

Test your setup

Once you have the confirmation page code setup on the site and you want to test that all is working correctly, please contact the Technical Services team and ask them to put you in to test mode.

Tracking code to put on confirmation of sale page

See sections 3 and 4 on how and what information to parse in to this code.

 <img src="https://www.awin1.com/sread.img?tt=ns&amp;tv=2&amp;merchant=MERCHANT_ID&amp;amount=SALE_AMOUNT&amp;ref=ORDER_REF&amp;parts=COMMISSION_GROUP:SALE_AMOUNT&amp;vc=VOUCHER_CODE&amp;testmode=1&amp;cr=GBP" />
 
 <form style="display:none;" name="aw_basket_form">
 <textarea wrap="physical" id="aw_basket">
AW:P|merchant_id|order_ref|product_id|product_name|unit_price|quantity|sku_data|cg|category
AW:P|merchant_id|order_ref|product_id|product_name|unit_price|quantity|sku_data|cg|category
AW:P|merchant_id|order_ref|product_id|product_name|unit_price|quantity|sku_data|cg|category
 </textarea>
 </form>
 
 <script type="text/javascript">
 //<![CDATA[
    /*** Do not change ***/
    var AWIN = {};
    AWIN.Tracking = {};
    AWIN.Tracking.Sale = {};
 
    /*** Set your transaction parameters ***/
    AWIN.Tracking.Sale.amount = 'SALE_AMOUNT';
    AWIN.Tracking.Sale.currency = 'GBP';
    AWIN.Tracking.Sale.orderRef = 'ORDER_REF';
    AWIN.Tracking.Sale.parts = 'COMMISSION_GROUP:SALE_AMOUNT';
    AWIN.Tracking.Sale.voucher = 'VOUCHER_CODE';
    AWIN.Tracking.Sale.test = '1';
 //]]>
 </script>
 
 <script src="https://www.dwin1.com/1234.js" type="text/javascript" defer="defer"> </script>

Examples

Standard Tracking Code

See below an example of the standard integration tracking code for a sale value of £100.00 for merchant number 1234 with an order number of 123456 and a voucher code of AW1234.

 <img src="https://www.awin1.com/sread.img?tt=ns&amp;tv=2&amp;merchant=1234&amp;amount=100.00&amp;ref=123456&amp;parts=DEFAULT:100.00&amp;vc=AW1234&amp;testmode=0&amp;cr=GBP" />
 
 <form style="display:none;" name="aw_basket_form">
 <textarea wrap="physical" id="aw_basket">
 AW:P|1234|123456|123|T-SHIRT|100.00|1|SKU:1111111|DEFAULT|SHIRT
 </textarea>
 </form>
 
 <script type="text/javascript">
 //<![CDATA[
    /*** Do not change ***/
    var AWIN = {};
    AWIN.Tracking = {};
    AWIN.Tracking.Sale = {};
 
    /*** Set your transaction parameters ***/
    AWIN.Tracking.Sale.amount = '100.00';
    AWIN.Tracking.Sale.currency = 'GBP';
    AWIN.Tracking.Sale.orderRef = '123456';
    AWIN.Tracking.Sale.parts = 'DEFAULT:100.00';
    AWIN.Tracking.Sale.voucher = 'AW1234';
    AWIN.Tracking.Sale.test = '0';
 //]]>
 </script>
 
 <script src="https://www.dwin1.com/1234.js" type="text/javascript" defer="defer"> </script>


Commission Group Tracking Code

See below an example of the commission group tracking code for a sale value of £100.00 for merchant number 1234 with an order number of 123456. The £100.00 order contains products in 4 groups: DVD, Video, CD & Books and the customer spent £25 on products from each group. A voucher code of AW1234 was also used in this example.

 <img src="https://www.awin1.com/sread.img?tt=ns&amp;tv=2&amp;merchant=1234&amp;amount=100.00&amp;ref=123456&amp;parts= DVD:25.00|video:25.00|CD:25.00|books:25.00&amp;vc=AW1234&amp;testmode=1&amp;cr=GBP" />
 
 <form style="display:none;" name="aw_basket_form">
 <textarea wrap="physical" id="aw_basket">
 AW:P|1234|123456|PRODUCT1|DVD1|25.00|1|sku:11111|DVD|KIDS DVDS
 AW:P|1234|123456|PRODUCT2|VIDEO1|25.00|1|sku:11111|VIDEO|KIDS VIDEO
 AW:P|1234|123456|PRODUCT3|CD1|25.00|1|sku:11111|CD|ROCK CD
 AW:P|1234|123456|PRODUCT4|BOOK1|25.00|1|sku:11111|BOOKS|ROMANCE BOOK
 </textarea>
 </form>
 
 <script type="text/javascript">
 //<![CDATA[
    /*** Do not change ***/
    var AWIN = {};
    AWIN.Tracking = {};
    AWIN.Tracking.Sale = {};
 
    /*** Set your transaction parameters ***/
    AWIN.Tracking.Sale.amount = 'SALE_AMOUNT';
    AWIN.Tracking.Sale.currency = 'GBP';
    AWIN.Tracking.Sale.orderRef = 'ORDER_REF';
    AWIN.Tracking.Sale.parts = 'DVD:25.00|video:25.00|CD:25.00|books:25.00';
    AWIN.Tracking.Sale.voucher = 'AW1234';
    AWIN.Tracking.Sale.test = '1';
 //]]>
 </script>
 <script src="https://www.dwin1.com/1234.js" type="text/javascript" defer="defer">  </script>
 
 <!-- *** End of Affiliate Window tracking code - DO NOT REMOVE *** / -->