programming arts…

Monitoring Ajax application usage and usability with Google Analytics Event Tracking APIs

I have an ajax application or website, what’s the best way to monitoring user interaction?

Google Analytics! (you can use it also if your webapp is an intranet app: GA API sends data to google server from javascript! Then you need just that your application user got an internet access)

How to use Google Analyitics API to log dynamic  page events?

Google introduced the awesome event tracking feature in Google Analytics API, so using the gaTracker object is very very easy

for instance:


<script>

var loggedUsername='<?php echo $_SESSION['<a class="zem_slink" href="http://en.wikipedia.org/wiki/User_%28computing%29" title="User (computing)" rel="wikipedia">username</a>']; ?&gt;'

function zoom(img){

logGASingleEvent('gallery','image_zoom',loggedUsername);

//other stuff

}

function logGAEvent(category,action,label){
     pageTracker._trackEvent(category,action,label,1);
}

</script>

echo '<img onclick='zoom(\"$gallery_img\");'  ="" src="$gallery_img">;';

logs a user click on an img tag  (in this case the javascrip t zoom() function related to this onClick DOM event).

Ps. i like to put username in label for having a final report like this (a per user action overview):

per user action report

…and this is the general event overview:

analytics event tracking report overview

Isn’t cool? Don’t you love Google?

See also:

Using GA Event API to Monitoring Website Performance

Reblog this post [with Zemanta]
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: , , , , , , , , , , , , , , , , , , ,

No Comments

rssComments RSS transmitTrackBack Identifier URI

No comments. Be the first.

addLeave a comment





Spam protection by WP Captcha-Free