Tuesday, September 30, 2008

Google Analytics

This is for Tate and anyone else out there wondering how they can learn a little more about who visits their blog. I'd like to suggest Google Analytics. GA is a free tool provided by Google that can not only tell you how many people are visiting your site, it can tell you where your visitors are from, if they found your site from another site or if they found you through a search engine (and if so what words they were searching on).

You can determine what posts are the most popular. You may find that most of you visitors find you from another blog that you didn't even know linked to you. You may find that you have a secret following of readers from Wisconsin or Switzerland. And for the other geeky people out there, it also gives you information like browser usage, OS and a ton of other stuff. It's all pretty interesting, and you'll probably find that you have a lot more people reading your blog than you thought. (Keep in mind that it won't give you the names of the people visiting your site or any other identifying information.)

Google has a comprehensive guide to setting everything up that covers everything, but I'm going to offer a reader's digest version here. Don't be intimidated, it's really quite simple and only takes a few minutes to set up.
  1. The first step is to create a GA account. If you're using blogger for you blog, or if you already have a Google account for anything else like Gmail, you can use that user name and password to log in. Follow the instructions to set up your account.
  2. Once everything's set up, from the main page in the "Settings" column, click "Edit". Then on the next page, click "Check Status" (it's towards the upper right hand corner of the page). On the next page you'll find a box with a bunch of code in it. It will look pretty scary, but don't worry about it, just select it all and copy it. This is your tracking code.
  3. Pasting the code
    • Sign into you blogger account, and select the "Layout" tab.
    • On the next page, select "Edit HTML".
    • You may want to follow the instructions at the top of the page for backing up your template, because if you mess up the next few steps your blog may not display correctly.
    • In the box of code, scroll down to the very bottom. You're looking for the "body end tag", which is usually in the second to last line of code and looks like this: </body>
    • Place your cursor just to the left of the body end tag, and paste the tracking code you copied in step 2.
    • The last part of you code should now look something like this:
      <script type="text/javascript">
      var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
      document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
      </script>
      <script type="text/javascript">
      var pageTracker = _gat._getTracker("UA-0000000-1");
      pageTracker._trackPageview();
      </script></body>
      </html>

    • Hit "Preview" to make sure everything looks ok, then hit "Save Template"
  4. Go back to your Google Analytics page, in the "Settings" column, click "Edit", then on the next page, click "Check Status" (just like in step 2). In the yellow box it should say
    Tracking Status: Ready Receiving Data
  5. At this point you're done, but you'll have to wait about 24 hours for results to start showing up. To view the reports, just sign into Google Analytics and click on "View Reports".
As a side note, if you ever change your template it will erase the tracking code, so you'll have to repeat steps 2-5 to get everything working again.

There are all sorts of other things you can do, like have it not count when you visit your blog (seriously, who cares if you blog was visited 20 times yesterday if 19 of them were you checking to see if anybody left any comments?), but that's another post. Good luck, and feel free to ask if you have any questions.

3 comments:

Kate said...

Alright here goes... I will let you know if I need any help.

Kate said...

Well that was too easy, feel free to teach me anything else I might want to know. Your instructions were perfect.

Eric said...

Glad it worked! Now you'll know how many people find your blog by searching on something like:
"Keep it bare! You will love the freedom!!"