AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
3.8K members online now
3.8K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Can I install same Google analytics code to my main site and blog subdomain

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Dear All,

 

Can I install same Google analytics code (analytics.js) which is added to my site, the same code to use in blog page (which is a subdomain)?

 

Details,

Main site URL: alcircle.com, developed in asp.net

Blog URL: blog.alcircle.com, in WordPress theme

 

Please help and guide.

 

Thank you

Best Regards,

Sandip Paul

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Sandip P
August 2016

Re: Can I install same Google analytics code to my main site and blog subdomain

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Dear Bronwyn,

Thank you for your kind help. I will try to create a new view as suggested
by you, and will update you on it.

Best Regards,
Sandip P

<edited by a Community Manager as noted below>
 
NOTE: This post has been edited by a Community Manager - per Community Guidelines - in order to remove contact information which was most likely due to an email or mobile footer. This is done in order to protect account security and/or privacy. Please be sure to remove this information in future replies. Thank you for your understanding.

View solution in original post

Re: Can I install same Google analytics code to my main site and blog subdomain

Top Contributor
# 2
Top Contributor
Hi Sandip :-)
Yes you can, just make sure if you are wanting to track site visitors between the two as the same visitor,
that the same tracking code is used on both and that the coolie domain is set to 'auto' in the tracking code
snippet (which it should be by default).

Then you should also leave your initlal GA View without any filters applied to it
Create a new View, then apply the following filter
Filter Type: Custom filter > Advanced
Field A: Hostname Extract A: (.*)
Field B: Request URI Extract: (.*)
Output To: Request URI Constructor: $A1$B1
Click Save to create the filter.

It prepends the domain name to the request URI in the GA reports so as to be able to track which domain/subdomain
a particular pageview occured on
Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here
Marked as Best Answer.
Solution
Accepted by topic author Sandip P
August 2016

Re: Can I install same Google analytics code to my main site and blog subdomain

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Dear Bronwyn,

Thank you for your kind help. I will try to create a new view as suggested
by you, and will update you on it.

Best Regards,
Sandip P

<edited by a Community Manager as noted below>
 
NOTE: This post has been edited by a Community Manager - per Community Guidelines - in order to remove contact information which was most likely due to an email or mobile footer. This is done in order to protect account security and/or privacy. Please be sure to remove this information in future replies. Thank you for your understanding.