Information Technology Reference
In-Depth Information
now you know how to create the tracking script object, but bear in mind that
no tracking is done unless the function is called from the page itself, as in clicking a
link and calling the wrapper function:
<a href='/thankyou.html' onclick='recordaction(23453,100)'>Buy</a>
or you could choose to create a complete wrapper function including the values
and call it once the customer confirms the buy (typically by clicking the Buy button).
With this method, everything is included in the tracking script object and it would
look like this:
version 4
<script language=”Javascript”>
function recordsale(orderid, amount) {
var tracking_object = createITT();
tracking_object.ACTION = '01';
tracking_object.ORDERID = orderid;
tracking_object.AMOUNT = amount;
tracking_object.submit_action();
}
40
recordsale ('orderid 1', 'USD100');
recordsale ('orderid 2', 'USD50');
</script>
version 5
<script language=”Javascript”>
function recordsale(orderid, amount) {
var YWATracker = YWA.getTracker(“1000123xxxx”);
YWATracker.setAction(“01“);
YWATracker.setOrderId(orderid);
YWATracker.setAmount(amount);
YWATracker.submit_action();
}
recordsale ('orderid 1', 'USD100');
recordsale ('orderid 2', 'USD50');
</script>
Here you are forced to inflate the ORDERID and AMOUNT values into the two
recordsale function calls in the end to use it correctly.
Search WWH ::




Custom Search