Reputation: 2194
Basically the question is in title: Can I use the same Google Analytics (gtag.js) tracking ID for multiple subdomains? I know it's technically possible (I tried it), but is it "wrong" in any way?
I would prefer to use a single ID for multiple subdomains for practical reasons and to keep them associated with the same website (for example www.domain.com, docs.domain.com and demo.domain.com). However, in "property settings", there is a "Default URL" setting, which perhaps implies it should run from specified domain only? Or maybe that's just "default".
I guess I could use "filters" to track specific subdomains. Just curious to know if the recommended behavior would instead be to create a new property (different ID) instead?
Thanks for any useful feedback!
Upvotes: 1
Views: 1186
Reputation: 188
As you have been told in the comment, the domain you are showing in the image does not affect data collection and is only for preview purposes.
In order to collect data from all your subdomains you don't have to change anything in the default code.
The option that provides such functionality is cookie_domain (which is set to auto by default). Check the documentation.
Upvotes: 1
Reputation: 2194
The answer must be YES. I see in analytics that one can setup multiple "views", each with different website URL's.
Upvotes: 2