Information Technology Reference
In-Depth Information
Let me show a quick example of how to set up the tracking script object and
how to call it. the tracking script function created next, also sometimes called a wrap-
per function , is completely unique to your site and can be constructed any way you
want. so our focus is on tracking multiple occurrences of the same action on the same
page (applying two variables wouldn't work):
version 4
var ACTION='01';
var AMOUNT='USD100.00';
var ACTION='01'; — ERROR, you cannot use the same variable twice
var AMOUNT='USD50.00'— ERROR, you cannot use the same variable twice
so to have two sales, not just in the same visit but on the same page, you could
create a wrapper function 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();
}
</script>
39
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();
}
</script>
Here i've created the version 4 tracking object by writing var tracking_object =
createITT(); and then applying the variables needed. i've then executed the tracking
script by submitting it: tracking_object.submit_action(); . You can extend beyond the
three variables i applied here.
Search WWH ::




Custom Search