How To Track Traffic Across Multiple Subdomains With Google Analytics


Google Analytics provides a default JavaScript code which will need to be implemented into the code of your web pages to start tracking the traffic to your website. However, you might have a site with subdomains, and if you do not customize your script, your data won’t be as accurate as it could be. Depending on how you currently have Google Analytics (GA) setup, you might see your primary site listed as a referring site.

Here are the five steps to follow to get the most accurate data from a website with multiple subdomains:


Create a profile for your main site in your GA account.

Step 1

Step 2:

To track traffic across subdomains, you will need to add a line of code to your script called _setDomainName(). For example, if contains subdomains, the code would look like the following:

Tracking Code

Step 3:

Create a duplicate profile for each subdomain and name the profile with the subdomain name. (Note: Your “UA-XXXXXX-X” will be the same). Look for “+Add New Profile” on the GA Overview page.

Step 2

Step 4:

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:

Step 4.1

Then look for “+Add Filter”:

Step 4.2

Now, add a filter only to include traffic to this particular subdomain:

Step 4.3

Step 5:

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: –  /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 differentiate the traffic for these pages.

To fix this, you will need to add an advanced filter to have GA show the full URL in the reports. Again, you will need to add a new filter:

Step 5

So this is how you can track your website traffic if you have a site with multiple subdomains – you only need one GA account and one GA profile with many duplicated profiles with predefined filters.

0/5 (0 Reviews)

Ready to Collaborate? Contact Us!

Recent Works SEO Case Study
BTO Sports Case Study Case Study Case Study
Tacori Social Engagement
Oxi Fresh SEO Case Study SEO Case Study
TIBCO case study
Teleflora Web Development


Get the Latest SEO News & Updates