Posted tagged ‘Analytics’

How to set up the Google tracking code on your site

May 2, 2012

 

Image representing Google Analytics as depicte...

Image via CrunchBase

 

How many of you know the number of visitors you had on your site this week? I’m going out on a limb and guess…not many of you. Next question, why haven’t you used Google Analytics to track your visitors? Do you think it is difficult to install the code, don’t know where to get the code from or even how to read the reports once you have them?

O.K. I hear your pain. To find out how easy it is to set up just follow along for the next several issues. I will give you action steps so you will up and following (stalking?) your visitors in no time. Let’s get started!

The first thing you need to do is sign up at the Analytics website here http://www.google.com/analytics. If you already have a Google account you can use that to sign in for Analytics.

Then you will need to enter the URL of the site you want to track and  get your tracking code. Here’s how to add the asynchronous snippet to your site:
The tracking code is profile-specific, so you can only access it from the Profile Settings screen for that profile.

Go to Analytics Settings and click “Edit” next to the profile used for your site. In the Profile Settings page, click the “Check Status” link. You’ll see something similar to the code snippet below, where XXXXX-YY indicates the profile ID for your Analytics account.

 It will look something like this:
 
<script type=”text/javascript”>

  var _gaq = _gaq || [];
  _gaq.push([‘_setAccount’, ‘UA-XXXXX-X’]);
  _gaq.push([‘_trackPageview’]);

  (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl&#8217; : ‘http://www&#8217;) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

Once you find the code snippet, copy and paste it into your web page, just before the closing </head> tag*.

If your website uses templates to generate pages, enter it just before the closing </head> tag in the file that contains the <head> section.

Install it on each page that you want to track. Then go to Webmaster Central – Verification home to add your site. It may take a few minutes for Google to find your site. Then you will need to verify your site. Once this is complete, Google will start tracking your visitors.

Well, that was easy wasn’t it? If you have questions feel free to ask. I’m a real person. I will answer your email.

See you in 2 weeks!

Joann Snell