Advertiser Tracking Guide/Reference Snippets
From Wiki
Revision as of 14:31, 25 March 2024 by Florin Oprea (Talk | contribs)
[-] Advertiser Tracking Guide
[-] Reference Snippets
[-] General Template
<img border="0" height="0" src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant={{advertiserId}}&amount={{totalAmount}}&ch={{channel}}&cr={{currencyCode}}&p1={{customParameter1}}&p2={{customParameter2}}&parts=DEFAULT:{{totalAmount}}&ref={{orderReference}}&testmode={{isTest}}&vc={{voucherCode}}" style="display: none;" width="0"> <form style="display: none;" name="aw_basket_form"> <textarea wrap="physical" id="aw_basket"> AW:P|{{advertiserId}}|{{orderReference}}|{{productId}}|{{productName}}|{{productItemPrice}}|{{productQuantity}}|{{productSku}}|{{commissionGroupCode}}|{{productCategory}} </textarea> </form> <script type="text/javascript"> //<![CDATA[ /*** 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.currency = "{{currencyCode}}"; AWIN.Tracking.Sale.custom = ["{{customParameter1}}", "{{customParameter2}}"]; AWIN.Tracking.Sale.orderRef = "{{orderReference}}"; AWIN.Tracking.Sale.parts = "DEFAULT:{{totalAmount}}"; AWIN.Tracking.Sale.test = "{{isTest}}"; AWIN.Tracking.Sale.voucher = "{{voucherCode}}"; //]]> </script> <script defer="defer" src="https://www.dwin1.com/{{advertiserId}}.js" type="text/javascript"></script>
[-] Native HMTL Example
<img border="0" height="0" src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=1001&amount=7.50&ch=aw&cr=GBP&p1=Next%20Day%20Delivery&p2=Royal%20Mail&parts=DEFAULT:7.50&ref=AA000006&testmode=0&vc=10PERCENTOFF" style="display: none;" width="0"> <form style="display: none;" name="aw_basket_form"> <textarea wrap="physical" id="aw_basket"> AW:P|1001|AA000005|BCAT-0001|Example Product 0001|7.50|1||DEFAULT| </textarea> </form> <script type="text/javascript"> //<![CDATA[ /*** Do not change ***/ var AWIN = AWIN || {}; AWIN.Tracking = AWIN.Tracking || {}; AWIN.Tracking.Sale = {}; /*** Set your transaction parameters ***/ AWIN.Tracking.Sale.amount = "7.50"; AWIN.Tracking.Sale.channel = "aw"; AWIN.Tracking.Sale.currency = "GBP"; AWIN.Tracking.Sale.custom = ["Next Day Delivery", "Royal Mail"]; AWIN.Tracking.Sale.orderRef = "AA000006"; AWIN.Tracking.Sale.parts = "DEFAULT:7.50"; AWIN.Tracking.Sale.test = "0"; AWIN.Tracking.Sale.voucher = "10PERCENTOFF"; //]]> </script> <script defer="defer" src="https://www.dwin1.com/1001.js" type="text/javascript"></script>
[-] Container Tag Example
var sProtocol = (location.protocol == "http:") ? "http" : "https"; var url = sProtocol + "://www.awin1.com/sread.img?tt=ns&tv=2&merchant=1001&amount=" + parseFloat(fTotalAmount).toFixed(2) + "&ch=" + sChannel + "&cr=" + sCurrency; for (var i = 1; i < (aAdditionalInfo.length + 1); i++) { url += "p" + i + "=" + aAdditionalInfo[i - 1]; } url += "&parts=DEFAULT:" + parseFloat(fTotalAmount).toFixed(2) + "&ref=" + sOrderReference + "&testmode=0&vc=" + sVoucherCode; var awPixel = new Image(0, 0); awPixel.src = url; var awProductsForm = document.createElement("form"); awProductsForm.name = "aw_basket_form"; awProductsForm.setAttribute("style", "display: none;"); document.getElementsByTagName("body")[0].appendChild(awProductsForm); var awProductsTextArea = document.createElement("textarea"); awProductsTextArea.id = "aw_basket"; awProductsTextArea.wrap = "physical"; for (var i = 0; i < aProductId.length; i++) { awProductsTextArea.value += "AW:P|1001|" + sOrderReference + "|" + aProductId[i] + "|" + aProductName[i] + "|" + parseFloat(aProductItemPrice[i]).toFixed(2) + "|" + aProductQuantity[i] + "|" + aProductSku[i] + "|DEFAULT|" + aProductCategory[i] + "\r\n"; } document.aw_basket_form.appendChild(awProductsTextArea); var AWIN = AWIN || {}; AWIN.Tracking = AWIN.Tracking || {}; AWIN.Tracking.Sale = {}; AWIN.Tracking.Sale.amount = parseFloat(fTotalAmount).toFixed(2); AWIN.Tracking.Sale.channel = sChannel; AWIN.Tracking.Sale.currency = sCurrency; AWIN.Tracking.Sale.custom = aAdditionalInfo; AWIN.Tracking.Sale.orderRef = sOrderReference; AWIN.Tracking.Sale.parts = "DEFAULT:" + parseFloat(fTotalAmount).toFixed(2); AWIN.Tracking.Sale.test = "0"; AWIN.Tracking.Sale.voucher = sVoucherCode; var awMastertag = document.createElement("script"); awMastertag.setAttribute("defer", "defer"); awMastertag.src = sProtocol + "://www.dwin1.com/1001.js"; awMastertag.type = "text/javascript"; document.getElementsByTagName("body")[0].appendChild(awMastertag);