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>']; ?>'
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):

…and this is the general event overview:
![]()
Isn’t cool? Don’t you love Google?
See also:
Using GA Event API to Monitoring Website Performance
Related articles by Zemanta
- New Google Analytics API Features (googlecode.blogspot.com)
- Getting more data out of the Google Analytics API (aussiewebanalyst.com)
- Analytics: Track Your Website Stats On-The-Go (iphone.appstorm.net)
Tags: access logging, ajax, dhtml, event logging, event tracking, ga, google, Google Analytic, google analytics, Google Analytics API, javascript, javascript logging, js events, logging, logging ui events, monitoring, UI, ui logging, usabilty, user experience analysis
No Comments
Comments RSS
TrackBack Identifier URI
No comments. Be the first.
Leave a comment


![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=996ff260-c305-420a-9e38-622b7f855aea)