Information Technology Reference
In-Depth Information
to enable Ajax tracking, you have to create a Javascript tracking object:
version 4
var tracking_object = createITT();
You can then apply values to defined properties of this object and submit it.
When submitting it, you have two possibilities:
version 4
tracking_object.submit();
tracking_object.submit_action();
depending on your Ajax application, you may decide whether you want to track
a page view before you track an action, or you may want to track the action only. You
can only submit once, so you would never have both submits in the same function.
Imagine a scenario where you would have an on-screen Ajax pop-up that shows
the shipping costs, ensuring people do not navigate away from your basket. I recom-
mend that you track such a pop-up as a page view:
version 4
var tracking_object = createITT();
tracking_object.DOCUMENTGROUP='Shipping Costs';
tracking_object.DOCUMENTNAME='Shipping Costs ZIP 10010';
tracking_object.submit();
123
the values in this example are inflated at runtime, depending on the actual ZIP
code. For complex Ajax websites, I suggest that you create wrapper functions to per-
form the Javascript calls and that you make the functions somewhat generic, like this:
version 4
<script language=”Javascript”>
function ypageview(vardocumentgroup, vardocumentname)
{
var tracking_object = createITT();
tracking_object.DOCUMENTGROUP=vardocumentgroup;
tracking_object.DOCUMENTNAME=vardocumentname;
tracking_object.submit();
}
</script>
We would call the new ypageview function with the following values:
ypageview('Shipping Costs','Shipping Costs ZIP 10010')
using the on-click knowledge from chapter 2, we could write an Html link
like this:
<a href='#' onclick='showshippingcosts(10010); ypageview('Shipping
Costs','Shipping Costs, ZIP 10010')'>CLICK HERE FOR SHIPPING COSTS</a>
Search WWH ::




Custom Search