Tuesday, March 18, 2008

Setting up Google Analytics & Webmaster Tools

A friend called recently and told me he'd started his own blog about comics and film. He's not very web savvy, and simply asked, "What should I do to make my blog successful?" My next couple posts cover the advice I gave him. The examples are tailored for a site using Blogger, but the advice applies to all types of sites.

The first thing I walked him through was setting up Google Webmaster Tools and Google Analytics. Webmaster Tools gives you information about your site's performance in search results, and Analytics gives you information about who's visiting your site and what they're doing once they reach your site. Here are the steps to sign up:

[Edit: Blogger is now integrated with Webmaster Tools, so you can skip steps 8-12 below and just click the 'Webmaster Tools' link at the bottom of your Blogger Dashboard.]

  1. Log in to Blogger and click the 'Layout' link for your blog.
  2. Click the 'Edit HTML' link.
  3. Click the 'Download Full Template' link to save a copy of your current Blogger template on your computer. That way, if you mess something up while you're editing your template, you can revert to this saved version.
  4. Leave the browser window with your Blogger template open. In a new window (or tab), go to http://analytics.google.com/.
  5. Log in to Analytics and click 'Sign Up'. Enter your site's URL and name your account something like "My personal sites" (you can add other websites to this account in the future if you like).
  6. Walk through the rest of the sign-up process. You should end up on a page that says 'Tracking Code' and contains a block of code. Copy this code.
  7. Go back to Blogger and scroll down to the bottom of your site's HTML template. You should see code that looks like this:
      </div></div> <!-- end outer-wrapper -->
    </body>
    </html>
    Paste the Analytics code that you copied right above the </body> tag, like this:
      </div></div> <!-- end outer-wrapper -->
    
    <!-- Analytics code -->
    <script src="http://www.google-analytics.com/urchin.js"
      type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "UA-1234567-8";
    urchinTracker();
    </script>
    
    </body>
    </html>
  8. Leave the browser window with Blogger open. In a new browser window (or tab), go to https://www.google.com/webmasters/tools/.
  9. Type your site's URL into the box on the Dashboard and click 'Add Site'.
  10. Click the 'Verify your site' link on the next page.
  11. In the drop-down menu, select the 'Add a meta tag' option. Copy the code that appears.
  12. Go back to Blogger and scroll up to the top of your site's HTML template. You should see code that looks like this:
    <head>
      <b:include data='blog' name='all-head-content'/>
      <title><data:blog.pageTitle/></title>
      <b:skin><![CDATA[/*
    Paste the Webmaster Tools code right after the <title> tag, like this:
    <head>
      <b:include data='blog' name='all-head-content'/>
      <title><data:blog.pageTitle/></title>
      <meta content='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
        name='verify-v1'/>
      <b:skin><![CDATA[/*
  13. Click the 'Save Template' button below your HTML template.
  14. Click the 'Verify' button in your Webmaster Tools account. Your site's status should change to Verified. If not, wait a few seconds and click 'Verify' again.
  15. Go back to your Analytics account and click 'Check status' for your tracking code. It should tell you that your code has been installed correctly and data is being collected.
  16. Go to your blog's homepage and view your blog to make sure that everything looks okay (make sure you didn't mess up your site's template while editing it). If everything looks okay, you can delete the copy of your template that you saved to your desktop. (If something looks wrong, you can erase your changes by uploading the template copy that you saved at the beginning.)

If you have problems with these steps you can drop me a note, or get help here: Blogger Help, Webmaster Tools Help, Analytics Help.

Next: A couple tips for your initial Analytics/Webmaster Tools setup

2 comments:

vwinter said...

Best answers to my questions i could find... thx for the great post!!!

Anonymous said...

...please where can I buy a unicorn?