Tracking Visitors in a Rich Media World, Part III: AJAX

|

Accessing the logging script and making calls to DCSMultiTrack from AJAX should be very simple since you are likely using JavaScript already to handle user interactions, build your XHTML controls, and utilize XMLHttpRequest. Even if you are using a different scripting language such as VBScript you can still make a call to a JavaScript function in much the same way you would from within JavaScript.

If you wanted to make the deployment of your AJAX ‘tagging’ more efficient rather than add a call to every object action you want to track you may consider adding it into your event handler function to your AJAX application that will automatically make calls to DCSMultiTrack when triggered:

Button1.onclick = updateData()

function updateData(event, param) {
var myurl = www.domain.com/service/ajax.aspx

http.open(“GET”, myurl + “?id=” + escape(param), true);
http.onreadystatechange = useHttpResponse();
DCSMultiTrack(“DCSURI”,”/ajax/menu/”+event.target+”/”event.type,”DCSext.param”,”param”)
http.send(null);

}

Here I have used the example of on click event handler but it could just add the call within a wrapped up function and attach this to a rootElement event handler. The issue there then becomes that you will be tracking all user interactions so what do you start passing as page URL’s and other parameters just to say represent a mouse drag.

Should the handler be attached to all events enabling you to collect information on any and every interaction? Or prehaps limited only to duistinct content loads/views within the applet? And what should you be passing as parameters? Why not join us to discuss this at Engage 2009 in our Workgroup.