Conversion Tag
  • 18 Nov 2024
  • Dark
    Light

Conversion Tag

  • Dark
    Light

Article summary

The Conversion Tag is a declaration of the AWIN.Tracking.Sale JavaScript object. This is done on the confirmation page to instruct the MasterTag that a conversion has taken place.

Subsequently, the MasterTag will parse the conversion information populated in the Conversion Tag, generate a set of tracking requests, and send them to Awin.

Tag Declaration Notice

The declaration must be done before the MasterTag loads. In a scenario where AJAX (or similar) is being used to load the order confirmation, then refer to example #2 as a re-declaration of the parent AWIN object will break tracking!

Template

/*** Do not change ***/
var AWIN = AWIN || {};
AWIN.Tracking = AWIN.Tracking || {};
AWIN.Tracking.Sale = {};
/*** Set your transaction parameters ***/
AWIN.Tracking.Sale.amount = "{{totalAmount}}";
AWIN.Tracking.Sale.channel = "{{channel}}";
AWIN.Tracking.Sale.orderRef = "{{orderReference}}";
AWIN.Tracking.Sale.parts = "{{commissionGroupCode}}:{{totalAmount}}";
AWIN.Tracking.Sale.currency = "{{currencyCode}}";
AWIN.Tracking.Sale.voucher = "{{voucherCode}}";
AWIN.Tracking.Sale.test = "{{isTest}}";

Parameter References

For guidance on how you should populate the variables in a given parameter, please see our Parameter Guidance article.

Example #1 - Declare conversion before MasterTag append

<script type="text/javascript">
/*** Do not change ***/
var AWIN = AWIN || {};
AWIN.Tracking = AWIN.Tracking || {};
AWIN.Tracking.Sale = {};
/*** Set your transaction parameters ***/
AWIN.Tracking.Sale.amount = "8.33";
AWIN.Tracking.Sale.channel = "aw";
AWIN.Tracking.Sale.orderRef = "AA000001";
AWIN.Tracking.Sale.parts = "DEFAULT:8.33";
AWIN.Tracking.Sale.currency = "GBP";
AWIN.Tracking.Sale.voucher = "10OFF";
AWIN.Tracking.Sale.test = "0";
</script>

Example #2 - Trigger conversion after MasterTag append

if (typeof AWIN != "undefined" && typeof AWIN.Tracking != "undefined") {
    AWIN.Tracking.Sale = {};
    AWIN.Tracking.Sale.amount = parseFloat(fTotalAmount).toFixed(2);
    AWIN.Tracking.Sale.channel = sChannel;
    AWIN.Tracking.Sale.orderRef = sOrderReference;
    AWIN.Tracking.Sale.parts = "DEFAULT:" + parseFloat(fTotalAmount).toFixed(2);
    AWIN.Tracking.Sale.currency = sCurrency;
    AWIN.Tracking.Sale.voucher = sVoucherCode;
    AWIN.Tracking.Sale.test = "0";
    AWIN.Tracking.run();
}

Example Requests

If the Conversion Tag and the MasterTag have both been implemented correctly, tracking requests such as the following will be made:

Example Request Notice

Depending on your advertiser programme's set up, you could see tracking requests being directed towards our alternative tracking domain zenaps.com. The number of unique request types can vary from two to five.

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/sread.php?a=1001&b=8.33&cr=GBP&c=AA000001&d=DEFAULT%3A8.33&vc=&t=0&cks=1001_1403695822_a430d81e22c9e8687f423efcf024fbaa&atp=&tv=2&tt=et&l=https%3A%2F%2Fwww.advertiser-domain.com%2Fconfirmation.php&ch=aw
https://www.awin1.com/alt.php?mid=1001&gv=1&a=1001&b=8.33&cr=EUR&c=AA000001&d=DEFAULT:8.33&vc=&t=0&ch=aw&l=https%3A//www.advertiser-domain.com%2Fconfirmation.php
https://www.awin1.com/m/1001.gif


Was this article helpful?