Tracking sub domains with Google Analytics

One of my friend asked about tracking sub domains with Google Analytics, It is a common question – many sites use sub domains, “What if you want to track a group of sub-domains in one profile and a second group of sub-domains in another profile? Or if you want to create new profiles for different groups of sub-domains to future? “

  • Create a profile for the Primary Domain
subdomains analytics1 300x178 Tracking sub domains with Google Analytics

Tracking sub domains with Google Analytics

The first step is to create a master profile. All web profiles, including profiles of various sectors on the basis of this profile. When you type a domain site uses the primary domain name website. In the following, I’m using www.mywebsite.com the domain name of the site.

After creating the profile shows the tracking code Google Analytics for the site. Before adding to your pages should be changed. It is necessary to force Georgia to use the main site for the cookie domain. This change will allow you to track every visitor unique in all domains under. In turn, we will collect all data on the site in one profile and and do ‘roll up’ reporting.

Old urchin.js tracking code:

 <script type="text/javascript"> _uacct = "UA-XXXXXXX-1"; _udn = "sitedomain.com"; urchinTracker(); </script> 

New ga.js tracking code:

 <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-XXXXXX-1");  pageTracker._setDomainName("sitedomain.com"); pageTracker._initData(); pageTracker._trackPageview(); </script>

Note: Use the new tracking code if possible, since it allows monitoring the site search and Rich Media Monitoring and exit links.

  • Create profiles for SubDomains

Once you create the master profile, you can begin to create profiles for each of the subdomains. Remember, each sub-domain profile is based on the master profile that you created in step 1. Here’s how to configure the new profile

subdomains analytics2 300x164 Tracking sub domains with Google AnalyticsNow that you’ve created the profile, be sure to add a tracking code on pages in the subdomain. Tracking sub domains with Google Analytics is the same as the tracking code that goes on the primary domain (the code in step 1).

  • Add Filters to Sub Domain Profiles

The next step is to add a filter to the sub domain profile so it only contains data for the appropriate sub domain. This is done using an include filter based on the hostname. Once this filter is in place you’ll have the master profile which will contain data for all sub domains, and this profile that will contain data for a specific sub domain.

subdomains analytics3 300x233 Tracking sub domains with Google AnalyticsTo create additional profiles for other areas just repeat steps 2 and 3. Obviously, the filter settings used in step 3 depends on the subdomain you want to include in the profile.

  • Creating Additional Profiles

Let’s say you need to create a profile for two sub domains: 1.website.com and 2.website.com. This can easily be done because the same tracking code is on both sites. All you need to do is add an include filter with the following settings:

subdomains analytics4 300x187 Tracking sub domains with Google AnalyticsAlthough the documentation Google describes a good way to track the sub-domains, I think this approach is better because of its flexibility. Moreover, because the tracking code uses the same all sub-domains that do not have to worry about placing the wrong tracking code on a subdomain.

 

Incoming search terms:

  • google analytics sub-domain profile
  • googles tracking domains
  • track subdomain
This entry was posted in Google and tagged , , , by Krunal Soni. Bookmark the permalink.

About Krunal Soni

Internet, new technologies and marketing has been my passion, I began my career with Internet, when I was in 11th class, and in my word, I cannot live without internet, I am managing many blogs and this blog is My passion is the reason why the domain name is "Internet expert" I have not started blogging full time. I'm the kind of person who just can't wait to get on a train and not know where I'm going. I definitely want to live life to the fullest. And that's the type of man I'm attracted to - somebody with that spontaneous spirit. I am not believe in spend too much time living in the ‘what if’ and need to learn to live in the ‘what is.’ My friends told me I tweet well you can follow me on Twitter ;) & I am avilable on Facebook & Google+ too.

4 thoughts on “Tracking sub domains with Google Analytics

  1. Your Post very informative for me and others. Keep it up.
    Thanks for sharing sub domain Analytics information. It’s too good.

  2. Hi Krunal Soni,

    Just for the argument sake- if you have like 1,2,3 …. and so on till 500 microsites for the parent domain? what will be the strategy?

    T&R,
    Nishanth T

Leave a Reply

Your email address will not be published. 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>

Enter your email address: