About Adam Taylor...

I am a student, blogger, lazy entrepreneur....


I write about: Analytics, blogging, search engine optimisation and social media marketing.


Find out more...

Google Analytics Tutorial - Setting up Google Analytics

This is the first of a number of Google Analytics Tutorials, written to provide you with the knowledge to be able to use Google Analytics for your own projects. This tutorial will cover basic setup and implentation of Google Analytics and is aimed at someone new to Google Analytics. However, other tutorials will cover more advanced topics such as: filtering unwanted data, setting up conversion goals, tracking e-commerce sites and more.

Basic Setup

If you have never used Google Analytics or any other of Google’s many services the first thing you will need to do is create a Google Account to be able to use the other services like Google Analytics.

After you have created your Google Account you then need to sign up to Google Analytics. Once this is done you need to add a new website profile for the site you wish to track.

adding a website profile to Google Analytics

You will then be provided with the tracking code you need to add to your website for Google Analytics to operate correctly. This code should be placed on every page [you wish to track] of your site. For this wordpress powered site I was able to insert the code into the footer template file. Inserting the code into an include or template file is far easier than manually adding it to every page and I would recommend doing it that way if you can. It is also advisable to add the code just before your closing </body> tag.

adding Google Analytics tracking to your site

After you’ve added this code to your website you will have to wait a little while (12-24hrs) as data is gathered about your website. You will, however, be able to see in your analytics overview ‘waiting for data’ by the status if you have installed the tracking code correctly.

Tracking websites that use subdomains

If your website uses subdomains you have to add the following line to the tracking code to be able to track the site correctly: _udn="mydomain.co.uk";. So if we used subdomains on this website our tracking code would look like this:

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript" >
_uacct="UA-xxxxxxx-x";
_udn=”conversion-matters.co.uk”;
urchinTracker();
</script>

Tracking third party domains

Perhaps your website has a shopping cart hosted on a third party domain that you would like to track. In this case, you have to modify the tracking tag and change any links that take a user from your domain to the third party domain.

You must include the lines in bold in the tracking code to track third party domains:

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript" >
_uacct="UA-xxxxxxx-x";
_udn=”none”;
_ulink=1;
urchinTracker();
</script>

Then for any links from your site to the third party domain you must rewrite then to this format:

<script type="text/javascript">
document.write('<a href="javascript:__utmLinker(\'https://www.securecart.com/?store=parameters\');">Purchase Now</a>');
</script>
<noscript>
<a href="https://www.securecart.com/?store=parameters">Purchase Now
</noscript>

If you use forms to take the user from your domain to the third party domain you must use the following code:

<form action="http://newdomain.com/form.cgi" onSubmit="javascript:__utmLinkPost(this)">

Now your Google Analytics service should be providing basic tracking capabilities and reporting about your website. Do leave a comment, or get in contact if you have any questions.

Related Articles:

Don’t forget to subscribe to the Conversion Matters feed!

Related Posts


Subscribe to the Conversion Matters feed!

2 Responses to “Google Analytics Tutorial - Setting up Google Analytics”

  1. David Vielmetter Says:

    Great article. I dumped my hosting companies Webstats after finding Google Analytics. But there’s not a whole lot of info on how to configure it the first time. Thanks for your article…got it setup in less than 15mins.

    David

  2. Adam Says:

    No problem David, glad it was helpful.

Leave a Reply

Subscribe to Comments?

Tamar Goes To Town 121 Tamar Goes To Town 120 Tamar Goes To Town 119 Tamar Goes To Town 118 Tamar Goes To Town 117 Tamar Goes To Town 116 Tamar Goes To Town 115 Tamar Goes To Town 114 Tamar Goes To Town 113