Home » How To

Adding Google Analytics To Your WordPress Blog

I recently had a Member ask about adding Google Analytics to his blog. Fortunately for him, he was using ABTheme, which makes this ridiculously easy to do. However for other people using other themes it IS possible – just not as easy.

For ABTheme it’s very simple:

  • You log in to Google Analytics and grab the code for your site (more information on the code itself is found on the Google site).
  • Log into Admin, and the ABTheme tab, CodeInsert subtab, and go down to the ‘Fixed Block’ section, and the ‘Below Blog’ code box.
  • If empty, just paste the Analytics code into the box; if it already contains other code, make sure to add it to the end of the text in that box.
  • Save it – you’re done.

Unlike the upper code chunks in the panel (which are moved around in the sidebar), these bottom sections are for fixed places on the blog. In this case, the fixed position at the very bottom of the blog. This makes it easy to add the Google Analytics code to your ABTheme-powered WordPress blog.

But you want it more complicated, and you don’t have ABTheme – what do you do?

  • Again grab the Google Analytics code for your blog.
  • In a text editor, load your theme’s .php file for the bottom of your blog. For very old themes, it might be the index.php file; however, most themes today are split into parts, and you’re quite likely looking for the footer.php file.
  • At the bottom of this file, you look for the closing body tag </body>. You then paste the code from Google just BEFORE this tag.
  • Save the new file, and upload to your WordPress blog in the /wp-content/themes/ directory, and the subdirectory for your selected theme.

(members can consult the WordPress video section on how to edit and FTP the theme)

And of course, in both cases make sure you go back into Google Analytics and confirm everything is set.

And as you can see ABTheme makes it much easier to adjust: however, with very little effort you can add Google Analytics to any WordPress theme.

Digg this! Add to del.icio.us! Stumble this! Add to Techorati! Share on Facebook! Seed Newsvine! Reddit! Add to Yahoo!

One Comment »

  • Michael (Internet Marketing) said:

    Hi Dave,

    Thanks for that very simple answer to adding Google Analytics.

    I have to say, ActiveBlogging is possibly one of my best subscriptions, and ABTheme is definitely the best theme I’ve ever used. I can’t even begin to tell you how many times I’ve had a “Wow!” moment while going through the theme and coming across a ‘push-button easy’ option for something I had struggled with for hours – sometimes days – trying to do on another blog.

    Thanks again for all the great info and a great product!

    Michael Ullman
    Analogy Marketing

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.