Google Analytics Implementation
"What gets measured, gets managed."
-Peter Drucker
If you have website, blog or mobile sites you want to track their performance. Getting visitors to your website is important, but it’s also important to understand how they are interacting with your website. Website analytics (the tracking of traffic to and on a website) helps website owners understand their online customers, potential customers and their interactions with their site. So lets start with steps for implementating Google Analytics :
Step 1: Generating GATC code
Step 2: Insert Google Analytics JavaScript Into Your Pages
I will also try to explain Google Analytics Tracking Code (GATC) in brief
Step 1: Generating GATC code
1) Sign in into Google Analytics(www.google.com/analytics). You can use gmail account or any email id to create account
2) Click the Sign Up button to continue.
3) Enter the URL of the site you wish to analyze
4) Give the site an account name.
5) Select the country your site is based in, or the country it is serving.
6) Select appropriate time zone. Its important to check when in their day most choose to use your site
7) Click Continue.
8) In the next window, provide your contact information.
9) Click Continue.
10) In the next window, read the Google Analytics terms of service. If you agree with them, click the Yes box.
11) Click Create New Account.
12) Google will provide you with a block of code. Copy this - you'll need to insert it into your web site.
Step 2: Insert Google Analytics JavaScript Into Your Pages
You must insert the code that Google Analytics provides you with into every page you want tracked. Paste the code above </head> tag or </body> tag in the html page.
GATC CODE
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXX-YY']);
_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>
a) UA-XXXXXX-YY: This is unique for each Account and must be used exactly as quoted or your data will be sent to another account.
b) Essentially, the line pageTracker._trackPageview() collects the URL of the pageview a visitor loads in their browser, including associated parameters such as browser type, language setting, referrer, and timestamp.
c) Before any code can execute the ga.js file, which contains all of the Google Analytics logic, this code loads that logic into the browser and requests ga.js from a Google server.Notice the ga.async=true part of the code. This part of the code tells the browser to load the ga.js file asynchronously.
Once you have uploaded the pages back to your site, you can begin tracking information.The moment you set up your account and insert Google's JavaScript into your pages, Google Analytics will be ready to provide you with charts that will give you an overview of your site's performance
Comments
Post a Comment