I have been playing with various ways (plugins) to insert the Google Analytics tracking code into my blogs, and a while back, I came across this one by Joost de Valk, a Dutch blogger, SEO specialist and plugin author amongst other things.
I love this plugin as it is simple to configure, places the ga.js script just before the </body> tag of the page, so you don’t have to worry that if for any reason the script will slow down loading of your page. By default it does not insert the tracking code into pages generated while you are logged on as a WordPress admin, so you do not skew your Analytics stats with your own clicking and previewing on your blog.
Furthermore, it automatically adds code to track all outbound links and downloads from your blog as well as links from your RSS feeds. I highly recommend this plugin, and also take a gander at Joost’s blog. It is crock full of useful, practical information for anyone using WordPress.
