3 steps to track sub domains with the new Google Analytics (Sept 2011)

Need to track multiple sub domains on one domain? Don’t fear the ‘profiles’ and ‘filters’ in Google Analytics, they’re very useful and actually fairly simple.

This tutorial assumes that Google Analytics is already installed on your website. If you operate a CMS, the following plugins are suggested:
Google Analyticator (WordPress)
Google Analytics (Drupal)
Google Analytics Tracking Module (Joomla)

So here is the scenario:

You want to track all of the sub domains individually to stop Google treating them as though they are all the root site. And, you would like to be able to track one or more of the sub domains individually.

Example domains:

www.domain.com
subdomain1.domain.com
subdomain2.domain.com
subdomain3.domain.com

 

Just follow these 3 easy steps:

1. Adjust tracking code:

First you need to add the following tracking code to all pages of your subdomains and main domains.

 

_gaq.push(['_setDomainName', '.domain.com']);

Make sure you include the ‘.’ before the domain (google seems to have made a booboo with this in some instructions)

tracking subdomains google analytics code snippet

tracking subdomains google analytics code snippet

NOTE: Be careful with the above. TrackPageview should only show once on the same page.

 

2. Set up 3 (or more) custom profile, each with a filter.

Old Analytics click here.
New Analytics: click the orange cog in the top right > Click ‘New Profile’

 

Note: before you start the next step, please note that you should not remove the existing profile. Retain it and rename it to ‘default’, or ‘all traffic’. DO NOT DELETE it!!!

1 to track the overall traffic.
tracking all subdomains google analytics filter configuration

tracking all subdomains google analytics filter configuration

 

2 to track subdomain1
track a single subdomain google analytics filter configuration only one

track a single subdomain google analytics filter configuration only one

 

3 to track subdomain2
track a single subdomain google analytics filter configuration only one

track a single subdomain google analytics filter configuration only one

 

3. Well, I lied. There is no step 3. Maybe set up some reporting if you need to…

Any questions on the above .. please ask away …

Note: Other solutions also exist for tracking between top-level domains and other Google Analytics sub domains tracking scenarios.

Posted in Analytics, measurement and monitoring, In-bound marketing | post a comment.
  • Get in touch

    t : 0207 202 4827
  • The Society is delighted to have iPER Media as its digital media partner. iPER’s expertise and willingness to innovate provided technical capabilities which enabled the Society to achieve effective brand exposure.
    Jonathan Byrne
    Royal Aeronautical Society
  • Get a website design quote - submit a brief!

    it only takes a minute, what are you waiting for?

2 Comments

  1. Fabricio, 12/03/2011

    Hi there,

    I don’t use the WWWin my website, how can I do it?

    my case is like:

    http://website.com
    http://apps.website.com
    http://games.website.com

    thx

    • Keir Jakich, 02/14/2012

      Hi sorry for the slow reply. I think I can help!
      There are a number of methods for adding or removing the ‘www’ sub-domain.
      If you are not a web hosting wiz-kid, the best method is to ensure the ‘web host control panel’ you choose adds the www automatically – one such control panel is ‘cPanel’ – cPanel is provided by many hosting providers like GoDaddy etc. Hope this helps. KJ

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Related Posts

    splash-twitter

    6 Twitter Best Practice blog posts for marketing businesses and non-profits

    Using social networks like Twitter can be a bit like riding a bike – a bit of perseverance and practice goes a long way. While you’re learning a bit of help from a sibling can certainly prevent a few grazed knees! I’m regularly asked for Twitter best practice marketing tips for businesses, brands and non-profits
    linkedin-logo

    LinkedIn and business – 5 tips to avoid pitfalls

    Thinking about linked in for your company/business? The following article fromWindmill Networking is a must read. LinkedIn has numerous pitfalls which can be easily avoided. 5 strategic tips for creating killer LinkedIn company pages
    dblclk_publishers_blog_full

    Generating website revenues just got easier

    Thanks to a new release of Googles website ad inventory management platform, DART (DFP), we’ve been able to streamline online ad trafficking and delivery for our customers that generate ad revenue from their websites, like The Royal Aeronautical Society. Major publishers across the world use DFP to serve and manage digital ad campaigns on their