Google Analytics Real Time Statistics using a Javascript Bookmarklet

There are many companies which develop web analytics software suites, hoping that they would upstage Google Analytics (some day). Their main claim being that they are ‘real-time’, while Google analytics is not. However that’s not true, because Google Analytics does collect stats in near real-time, but for some reason they never show the latest stats by default, it’s always a day old. If you want to see your latest stats, you can use the date selector combo-box to change the date range to include today’s stats. Here’s a tutorial which shows how. However its cumbersome to do that all the time. So I created (mostly stole) a bookmarklet to always include the latest stats. Continue reading

Javascript: missing } in XML expression

There are some issues which are almost impossible to debug, but when you spot whats wrong, you feel incredibly stupid. This was one of those errors.

Got this error, when I copy-pasted javascript code from the <head> of an HTML document and spent close to half an hour figuring out what was wrong. So what was wrong? Well I forgot to strip the <script></script> tags from the Javascript that I copied!