Tracking Ajax Interactions

The term Ajax is used to refer to a variety of specific combinations of technologies. Most of these technologies focus on the use of JavaScript to directly modify the web page using a Document Object Model (DOM), based on customer interaction and data fetched from the server.

Ajax can be used to provide rich applications within the web browser ranging from calendar applications to mapping tools, and can also be applied in a simpler form for minor changes like updating a drop-down menu based on visitor input.

Because Ajax typically uses JavaScript events, implementing dcsMultiTrack within an Ajax application is straightforward. If an Ajax event is triggered by a customer interaction that you want to report on, the same Ajax event that updates the page in response to that interaction can also call the dcsMultiTrack function.

The following example illustrates a simple Ajax control implementation where the visitor's selection in a drop-down menu changes the options available in a second drop-down menu. The dcsMultiTrack function tracks each time a user chooses a different option in the first drop-down box.

<select name="drop-down1" onChange="UpdateDropDown(this.value);">
<-- options -->
<select name="drop-down2">
<script type="text/javascript">
function UpdateDrownDown(OptChoice) {
var drop2 = parelmts["drop-down2"];
// fetch data for the second dropdown
parelmts.length = xmlreply.length;
for (o=1; o < xmlreply.length; o++) {
drop2[o].text = xmlreply[o];
dcsMultiTrack('DCS.dcsuri', '/dropdown.html', 'WT.ti', 'Drop%20Down',
'DCSext.Choice', OptChoice);

In this example, each use of the first drop-down menu is reported as a virtual page view at the URL The user-defined Choice parameter is also populated with the selection the visitor made in the drop-down menu.

Due to the wide variety of Ajax implementations, attempting to provide examples for every possible scenario is beyond the scope of this document. However, the examples provided are applicable to nearly any Ajax application. In most cases, the modification to the DOM is encapsulated within a function. Therefore, activating the dcsMultiTrack function within your own function is a discreet method to implement Webtrends tracking within your Ajax application.