1.1K members online now
Discuss discrepancies between AdWords and Google Analytics data, linking AdWords and Google Analytics, importing your goals/Ecommerce transactions into AdWords, and setting up Remarketing
Guide Me

Google Analytics Tracking for Domain and Sub-Domain

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭
Hi Team,

I am little bit confused, Should I need to use the same google analytics code for my domain and sub-domain websites for not? if no then, then will be the pros and cons for the same?

Kindly help me out!!

Thanks for your time and effort in advance!!

1 Expert replyverified_user

Google Analytics Tracking for Domain and Sub-Domain

Top Contributor
# 2
Top Contributor



Yes, you can use the same tracking code for your subdomains, you can set up a separate view for each and use include only traffic to hostname filters to include data only from a specific subdomain. Make sure you keep an unfiltered view.

You can also have a view that includes traffic from all subdomains and record the domain name along with the paths using an advanced view filter:


There are no cons using this setup, let me know if you have questions.


Of course if the websites on the subdomains are unrelated and you want to track them in separate properties that is also OK.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Google Analytics Tracking for Domain and Sub-Domain

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Arnold,

Thanks for sharing your feedback and experience.

It really helps me a lot.

Ajeet Kumar