August 10, 2007 – 1:57pm Tracking AJAX applications with Google Analytics

In doing some research today for a client, I learned that it is indeed possible to track ajax requests with Google Analytics. All you have to do is make a call to the urchinTracker passing it the page name of the request and it will do the rest. Typically you will want to do this in the code section that handles the ajax response:

var myAjax = new Ajax.Request(
  url,
  {
    method: 'get',
    parameters: pars,
    onComplete: function() { urchinTracker("/yourAjaxPageName" ); }
  }
); 

More on this can be found in the Google Analytics Help Center.

Posted in  Web Development   |  delicious  Digg

Post a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word