Information Technology Reference
In-Depth Information
Tracking Multiple Actions on the Same Web Page
Finally we come to some less strict scenarios, such as the need to record both a sale
action and a newsletter signup action on the same web page. this is very much a con-
tinuation of the tracking script object debate from the previous section. You could cre-
ate a wrapper function that looks like this:
version 4
<script language=”Javascript”>
function recordaction(actionnumber) {
var tracking_object = createITT();
tracking_object.ACTION = actionnumber;
tracking_object.submit_action();
}
</script>
version 5
<script language=”Javascript”>
function recordaction(actionnumber) {
var YWATracker = YWA.getTracker(“1000123xxxx”);
YWATracker.setAction(action);
YWATracker.submit_action();
}
</script>
41
the good news is that Yahoo! Web analytics has a shortcut to do this as well.
When you need to track multiple actions on the same web page, you can do so by
simply adding multiple actions in one request. so the code for the previous example of
recording both a sale and a newsletter signup on the same page could look like this:
version 4
var ACTION=”01;02”;
var AMOUNT=”USD100.00;”;
version 5
YWATracker.setAction(“01;02“);
YWATracker.setAmount(“USD100.00;”);
Let's see a more detailed example so you can truly understand the syntax. this
example shows how to record a sale action of Usd (United states dollars) 100, a news-
letter signup, and finally a pending sale of Usd 2.50:
version 4
var ACTION=”01;02;PENDING_SALE”;
var AMOUNT=”USD100.00;;USD2.50”;
Search WWH ::




Custom Search