Tag Archive | "Google Analytics"

Google Analytics Tip – Tracking Subdomains

Tags: , ,

Google Analytics Tip – Tracking Subdomains

Posted on 20 May 2010 by RChurt

Here is the step by step on how to track a subdomain in Google Analytics. This will work for anything like blog.domain.com etc which may be set up for strategic purposes.

How to add a subdomain as a new profile:

This is the easiest way to track a subdomain. Creating a separate profile for each subdomain allows you to track traffic in Google Analytics for each subdomain separately.
  1. When you are in the analytics overview/profiles section (where you see your URL, view report option and some overview stats) there will be an option (within the gray area) on the right to click “+ add a new profile” … choose that
  2. Add a Profile for a new domain and enter “subdomain.example.com” as the domain. (note you do not want to add www. for a subdomain at all)
  3. Just copy the new code that is then provided into your HTML footer.

How to track a subdomain within your existing Google Analytics profile:

This option is to track subdomains within the same profile as the domain. (this is more complex) In order to do so, you’ll need to add a line to the tracking code on each page of your site. The instructions below assume that this profile was set up with the primary domain as the listed website (e.g. .example.com)
  1. 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”>
try{
var pageTracker = _gat._getTracker(“UA-xxxxxx-x”);
pageTracker._setDomainName(“.example.com”);
pageTracker._trackPageview();
} catch(err) {}
</script>

Enhanced by Zemanta

Comments (1)

Great Friday Reads…

Tags: , , , , , , ,

Great Friday Reads…

Posted on 10 July 2009 by RChurt

It’s been a busy week, and finally the sun is out.

Excellent advice all around on Google Analytics – Site Architecture & Google Analytics. They also offer great insight into Google AdWords, especially as it applies to the new interface. Check’em out.

Another long time favorite, Hubspot offers some good advice about how to stop obsessing over the number of blog comments

More on PPC, using Geo Targeting to boost your campaign. The great thing about AdWords is that you can do exactly that, pick which part of the country you want to target. Sometimes going for those broad terms can be costly but not necessarily so if targeted right.

5 Things Small Businesses Can Learn From Big Business Social Media Campaigns – Do I need to say more about it…definitely worth a read.

Last but not least, Google introduced their new Chrome OS (operating system). Here’s why Michael Gray is looking forward to it and why Microsoft shouldn’t worry yet

Have a great weekend everyone!

Reblog this post [with Zemanta]

Comments (0)

About the Author


Put on your thinking caps - I am, Rebecca Churt, an Inbound Marketing consultant, and am here to share my thoughts (and only my thoughts) on blogging, SEO and social media.

Contact me if you are a small business or non-profit in need of marketing assistance or interested in having a custom blog for yourself. See examples of my design work.