Wednesday, May 21st, 2008...10:45 am

Accurate Analytics Data Series: Subdomains

Jump to Comments

Analytics data is a websites life blood, if you are giving the wrong blood to your college website you are going to kill it! Do you know if your analytics code is set up correctly, just because you are receiving data does not mean you are receiving the correct data. Let’s take a step back from trying to advance our websites and make sure the information we are using to advance our site is correct. We can also look at a couple tools we can use to help us.

The Bad News

One of the major problems with college website is they normally span a number of subdomains, it is even worse if they also span domains. I am going to be completely honest, if you do not have the dream team of web developers for your college website you are never going to be able to handle multiple domains. My suggestion, is create new profiles for each domain, and do the best you can from there. You can still use optimization software which is important.

The Good News

Managing many sub domains is straightforward, you will have more of a problem getting code on all of the pages, but hopefully you have worked that out at by now. Also, you can track sub domains in separate profiles, but you need to recognize if you are measuring goals that span subdomains you need to have them in the same profile.

Here is what you need to change on your Google Analytics code for multiple subdomains:

Add the following line (in bold) to the tracking code on all pages of your subdomain and your main domain:

<script type="text/javascript">
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">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._setDomainName("example.com");
pageTracker._initData();
pageTracker._trackPageview();
</script>

Note the above information was taken from the Google Analytics help page.

How to know if your code is installed correctly

Take a look at Site Scan by EpikOne. Site scan scans your website and checks to make sure the code is installed correctly. It is an excellent resource and worth using, especially if your department is organized enough to take advantage of it.

Note:

  • If you are using Google Website Optimizer it will throw errors on the pages that have both Google Website Optimizer code and Google Analytics code.

How many of you are at a point where your Analytics data is accurate and providing you with information to improve your website?

Leave a Reply