0845 205 0292

Request A Free Website Analysis

Close

How to setup Google Analytics

February 4th, 2010 by

Google Analytics is a free service from Internet giant Google. It allows webmasters to track information such as page views, traffic sources, pay per click performance, ecommerce tracking, conversion tracking and more detailed information such as the location of visitors and what browser they are using. It is an invaluable tool for those with an SEO campaign as amongst other things it allows you to see which search engine keywords are performing well or not and you can compare these against other keywords or traffic sources.

Also of interest are the conversion tracking and ecommerce tracking features. The conversion tracking allows you to track when visitors have filled out a contact form, signed up, completed an order, or anything else that you can define as a conversion. This way you can see, in addition to how many people have visited your website, how many have completed a certain action; generally the bigger the ratio of conversions to visitors the better. Ecommerce tracking allows the same benefits for purchases, but with much more detail. You can see which products are the most popular, how much revenue you have generated for a given period of time and how many items you have sold.

Tracking Code

To add the Google Analytics tracking code to your website, log in to your Analytics, go to Overview, select the individual account/website. Click Edit and on the next page click Check Status and a text box with the HTML code in it will appear. The code will look something like this:
<script type="text/javascript">// <![CDATA[
     var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
// ]]></script>
<script type="text/javascript">// <![CDATA[
     try{ var pageTracker = _gat._getTracker("UA-xxxxxx-x"); pageTracker._trackPageview(); } catch(err) {}
// ]]></script>

Copy this code into the HTML source of your website just above the closing </body> tag on every publically accessible page. This will allow Google Analytics to start reporting on data such as traffic sources, browser versions etc.

Conversion Tracking

Next you may want to set up conversion tracking. To do this click Edit next to the website profile. On this page you will see a “goals” section. Enter the name for the goal and a URL for this goal. An example might be the thank you page after a visitor has filled out a contact form. The conversion tracking code will look something like this:
<!– Google Code for purchase Conversion Page –>
<script type="text/javascript">// <![CDATA[
      var google_conversion_id = 000000001; var google_conversion_language = "en_GB"; var google_conversion_format = "1"; var google_conversion_color = "993333"; if (1) { var google_conversion_value = 1; } var google_conversion_label = "purchase";
// ]]></script>
<script src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height=1 width=1 border=0 src="http://www.googleadservices.com/pagead/conversion/1061401171/imp.gif?value=1&#038;label=purchase&#038;script=0">
</noscript>

Copy this into your HTML source code for the page you want to track and place it just above the normal tracking code for Google Analytics. Now whenever anyone goes to the page it will register as a conversion in Google Analytics and you will be able to track conversion rates and other data relating to it.

Ecommerce Tracking

Perhaps the most useful for an ecommerce site is the ecommerce tracking. This allows you to track in fine detail orders made through your website. The tracking code for ecommerce tracking should be placed on the page that the user is directed to after paying for their order. This is the first bit of code that should be entered:
pageTracker._addTrans(
"1534", // Order ID
"12 Road Street", // Affiliation/Address Line 1
"100", // Total
"15", // Tax
"3.50", // Shipping
"Liverpool", // City
"Merseyside", // State/County
"GB"// Country
);

This should be placed within the normal Google Analytics tracking code, under the line “pageTracker._trackPageview();”. Obviously it should be changed to reflect the order information; I have commented next to each line what information should be in it. Next, you will have to track each product that was in the order. The code looks like this:
pageTracker._addItem(
"1534", // Order ID
"PRODUCT1", // SKU (Product code)
"Product 1", // Product Name
"Products", // Category
"5.99", // Price
"5"// Quantity
);

Again this should be changed for each product and the values are commented for what information should be in them. This snippet should be repeated for each product and placed directly under the the main order information. Finally, under these product snippets, place this one last line of code:
pageTracker._trackTrans();

Now the ecommerce tracking should work.

Discuss this post on the SEO Forum.
<!– Google Code for purchase Conversion Page –>
<script type=”text/javascript”>// <![CDATA[
var google_conversion_id = 1061401171; var google_conversion_language = "en_GB"; var google_conversion_format = "1"; var google_conversion_color = "993333"; if (1) { var google_conversion_value = 1; } var google_conversion_label = "purchase";
// ]]></script>
<script src=”http://www.googleadservices.com/pagead/conversion.js”>
</script>
<noscript>
<img height=1 width=1 border=0 src=”http://www.googleadservices.com/pagead/conversion/1061401171/imp.gif?value=1&label=purchase&script=0″>
</noscript>

This entry was posted on Thursday, February 4th, 2010 at 1:17 pm . RSS GlobeYou can follow any responses to this entry through the RSS feed.

Link to us

If you want to link to this blog, copy and paste the following HTML code to your website.

One Response to “How to setup Google Analytics”

  1. Hi there,

    I think you’ve confused Google Analytics goals and AdWords Conversion Tracking. Under your heading about Goal configuration you say to paste a “conversion tag” on your goal page when setting up the Goal in Google Analytics. This is, in fact, completely wrong. The conversion tracking code your used is AdWords conversion tracking, which is completely unrelated to Google Analytics. Pasting your AdWords conversion tag on your goal page won’t put any data into Google Analytics.

    Best,

    -Caleb Whitmore

Navigation

Blog Categories

Free SEO Analysis & Proposal

From The Blogread news

Latest Newsread news

  • MAY 15
    With over 10million users in the UK and a somewhat eventful 12 months behind it, Twitter have finally agreed to work more closely with Government and policymakers in the UK. The Social Network currently has over 140million user...
  • MAY 14
    Following the recent Panda and Penguin updates recently, the content written for websites has become more of a focus; being more relevant and of better quality. Google is penalising content which is full of keywords to the point o...

Clients Say...

"We've long been considering an SEO campaign and have researched the benefits that it could potentially bring to our web presence," commented 3663 Catering Equipment's Managing Director Paul Knight. "The team at Click Consult put together a very attractive package and we're pleased to be able to enter into a sound business partnership with them. We're looking forward to seeing the results they can provide for the 3663 Catering Equipment website moving forward."

3663

Managing Director - 3663 Catering

"We have been working with Click Consult for over a year now. We are delighted with the increase in unique visitors to our site and they have far exceeded our conversion KPI metrics for customer database registrations. We rank in the top 3 for all keywords that we asked Click Consult to optimize for us. This agency know how to produce results."

hills pets

Managing Director - Liverpool One

"Whilst we have a long term keyword strategy, Click Consult have a good appreciation of our business and have a flexible approach to implementing short term keyword strategies to coincide with the peaks of the retail calendar. I receive a monthly performance report from Click Consult detailing the relevant data I require but in addition, I can review the work being undertaken at any time by logging in to their bespoke reporting system."

hills pets

CRM Manager - Liverpool One

"Hills has been looking for an agency that is able to quickly deliver in the search marketing area and catapult EMEA websites ahead of the competition. Taking SEO Consult for this project turned out to be a smart choice. Not only have they managed to significantly increase search engine traffic to our websites, but they also come with innovative ideas that can be turned to reality. I can simply say they deliver. And it's always a pleasure talking to them."

hills pets

Managing Director - Hills Pets