Here are the 5 steps to follow in order to get the most accurate data from a website with multiple sub domains:
Create a profile for your main site www.mysite.com in your GA account.
To track traffic across sub domains, you will need to add an additional line of code to your script called _setDomainName(). For example, if www.mysite.com contains sub domains, the code would look like the following:
Create a duplicate profile for each sub domain and name the profile with the sub domain name. (Note: Your “UA-XXXXXX-X” will be the same). Look for “+Add New Profile” on the GA Overview page.
Add a predefined filter to each duplicated profile. Look for “Edit” on the right side of the Overview page in the same line as the profile:
Then look for “+Add Filter”:
Now, add a filter to only include traffic to this particular subdomain:
If your subdomains contain URLs with the same request URI, you will need to do one more step. The request URI is everything that comes after the domain name on a URL – for example:
www.mysite.com/page1 – /page1 is the request URI. GA reports only show the request URI and if the main site and subdomains contain the same request URI, you will not be able to differenciate the traffic for these pages.
In order to fix this, you will need to add an advanced filter to have GA show the complete URL in the reports. Again, you will need to add a new filter:
So this is how you can track your website traffic if you have a site with multiple sub domains – you only need one GA account and one GA profile with many duplicated profiles with predefined filters.