Adding Google Analytics to a Subtext Blog

I don’t know if there are better website statistics tools out there but Google Analytics is chock full of features and really simple to use/setup. Oh yeah… and it’s free! Looking around the internet there seems to be 3 ways of adding the Google Analytics tracking code to a Subtext blogging platform. So once you get your Subtext blog up and running, sign-up for a Google Analytics account which includes both free and paid services. Once you get your tracking code snippet from Google you can put it into your site using one of these methods:

  1. Add it to the “Static News/Announcement” in the “Configure: Manage your blog” menu item when you are logged into the Subtext Admin.
  2. Add it to the PageTemplate.ascx file which is the skin’s master page control. Look in the Skins directory under the skin your site is using.
  3. Add it to the dtp.aspx page that is located at the root of your Subtext install.

I didn’t want to put it using the Static News/Announcements method because it was meant for something else and someday I may want to use that feature. Also method #1 put the code snippet at the top of the page before the post entries whereas Google’s suggestion is to put it at the bottom of the page before the </body> tag. Method #2 was a good option but if I want to change my skin to refresh my site’s look and feel I’d have to do the same thing on each skin that is loaded for my site. I ended up choosing method #3 because it placed the code a lot closer to where Google wants and if I want to change my sites skin I don’t have to edit the skin’s master page.

There’s also a new tracking code provided by Google (December 2007) called ga.js instead of the older soon to be legacy: urchin.js. I haven’t seen the reports  because I don’t have statistics yet but Google says there will be new advance features and sophisticated reporting, so upgrade your tracking codes!

3 thoughts on “Adding Google Analytics to a Subtext Blog

Comments are closed.