NavigationtagsRecent comments
User login |
Getting statistics about events that don't trigger page requests with Google AnalyticsYou probably already heard of Google Analytics. It's a pretty nice program that (basically) gathers data about visits of your site and creates reports of it. It works by including some JavaScript code on your page, so that each page request triggers a call to the Analytics tracker sending along some data such as which page is requested and which resolution was used. (no personal or other privacy-sensitive data is sent). But here is the deal! I just discovered that you can also track events that don't require page requests! The principle is very easy: similar to normal page loads which trigger a call of the JavaScript function urchinTracker() you just add onClick="javascript:urchinTracker('/this-is-something-i-want-to-track');" to your hyperlink. Now we also know why Google says the "normal" tracking code should be put at the end of the page, right before the </body> tag. I always wondered why they recommend this weird location. This is because calls like the ones above should happen prior to the "normal" one. If only I had known this earlier. I would love to have known an accurate number of downloads of my thesis text (and the number of unique downloaders) :-) For those who don't have Google Analytics setup yet: Have fun tracking all events on your website! Trackback URL for this post:http://dieter.plaetinck.be/trackback/18
Submitted by Dieter_be on Sun, 06/24/2007 - 19:27. categories [ ]
|
Post new comment