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.
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.
Make sure you include the ‘.’ before the domain (google seems to have made a booboo with this in some instructions)
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.
2 to track subdomain1
3 to track subdomain2
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.