Adding Google Analytics Code to Your WordPress Site

I use Google Analytics as one method of tracking my sites stats. It is one of many options available to bloggers.

In order to track your sites information, Google Analytics requires you to place a few lines of code before the ending body tag (</body>). on your site. If you change your theme  then you’ve got a problem. You will need to add this code to your new theme. Not a big deal - unless you forget.

To avoid this issue I set out to find a plugin that would add Google Analytics to my site. This way it wouldn’t matter if I changed my theme, the code would continue to work.

What I found instead was an even simpler solution. If you use a widgetized theme on WordPress (and WordPress 2.2.2 has widgets built in) then all you need to do is add the Google Analytics code to a text widget and leave the title bar blank.  Jon Symons, in a guest post at eMoms at Home, has written the details as to how this works. It couldn’t be easier! And apparently it works for other stat packages as well, although I have not tried this.

For those of you who would rather use a plugin, there are several plugins available. These include Semiologic’s Google Analytics plugin, Ultimate Google Analytics, and Google Analyticator. Again, I have not used any of these plugins so I cannot vouch for their usability.

Share and Enjoy:
  • Digg
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Reddit
  • SphereIt
  • Netscape
  • Mixx

Post a Comment