How to set up the Google tracking code on your site


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 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’]);

  (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;) + ‘’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);


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

Explore posts in the same categories: Business, Marketing

Tags: , , , , , , ,

You can comment below, or link to this permanent URL from your own site.

3 Comments on “How to set up the Google tracking code on your site”

  1. magiczon Says:

    Wow, amazing blog structure! How lengthy have you ever been running a blog for? you make running a blog glance easy. The overall glance of your website is excellent, as well as the content!

  2. Hi, how do I install google analytics tracking code for Can I install it only for hosted sites?

    • jlsnell Says:

      Hi, thanks for the question. Here are 3 ways to install GA on WordPress self hosted sites.
      Direct Paste Method: Copy the code that you received when signing up with GA, and paste it in your theme’s footer.php right above the tag.
      Functions.php Method: Add the following code in your theme’s functions.php file and don’t forget to paste your Google Analytics code here.
      4 // Paste your Google Analytics code from Step 6 here

      Plugins Method: There are tons of plugins available to add Google Analytics to your site. However, it is probably best to just use a simple light-weight plugin like: Insert Header and Footer

      Free WordPress you can’t install GA on

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: