How to Install Google Analytics on your website
21 Jun
Being an avid and interested user of web analytics platforms in general I’ve managed to install Google Analytics a number of times in various ways. Many first timers get confused with the documentation that Google Analytics gives or the code provided. Then you’ve got the problem of trying to decipher the standard reports that Google Analytics provides to you. All is not lost! Depending on where you are in your implementation or understanding of Google Analytics this article will walk you through the finer points of getting everything setup.
Getting a Google Analytics Account:
First things first, if you haven’t signed up for a FREE Google Analytics account you will need to do this first. Click here to do this now! Once you do this you can move onto the following steps.

Creating a Website Profile
The first step that you need to take once you have your Google Analytics account is creating a website profile. A website profile allows you to define the domain name that you are going to be tracking and whether it’s an existing domain name from your Google Analytics account or a new one. To create a website profile for the domain name you want to track you are going to need to take the following steps…
1. Click the “Add Website Profile” link
2. Fill out the information for your website’s domain name
3. Click the “Finish” button
Getting the GATC (Google Analytics Tracking Code) from Google Analytics:
Now that you have an account open with Google Analytics and you created a website profile you are going to need to generate the Google Analytics tracking code that you will later add to your website and do get this you will need the Google Analytics Tracking Code. To do this you will need to do the following…
1. Click “Edit” next to the website you’ve setup.
2. On the “Profile Settings” page for your website click the “Check Status” link which will take you to the “Tracking Code” page.
3. The Google Analytics Tracking Code comes available in 3 options including Standard, Advanced and Custom
The Standard Google Analytics Tracking Code comes with the ability to be used on a single domain name (This is the option most beginners should choose), one domain name with will multiple subdomains or multiple top-level domain names.
The Advanced Google Analytics Tracking Code comes with the built in ability to be used on a single domain name (This is the option most beginners should choose), one domain name with will multiple sub domains or multiple top-level domain names or tracking websites built for mobile phones and devices that use either PHP, ASPX, JSP or Perl coded web pages.
The Custom Google Analytics Tracking Code comes with a copy and paste functionality so that you can use this however you see fit. This option is more for the advanced user who is comfortable with coding so I personally would NOT recommend this option for beginners.
Implementing the Google Analytics Tracking Code
Google Analytics recommends that you copy and paste the snippet of code into the head section just before the end </head> HTML tag on the pages in your website.
<script type=”text/javascript”>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-#######-#']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement(’script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(’script’)[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
Once you’ve got this added you will need to go back into your Google Analytics account and click the “Save and Finish” button. This will cause Google Analytics to verify the tracking code installed on your website and you’ll be able to capture the core metrics of your website.




