问题
So, say I want to track traffic to different environments, but in the same domain
https://portal.mywebsite.net/
and separately track traffic to
https://production.mywebsite.net/
Sorry if this is a stupid question, but do you do this through filters, or do you have to setup new properties per environment? thanks in advance, I'm a noob to GA.
回答1:
Create two new views one for portal and one for production:
- Start with applying a filter to your portal view. Go to View > Filters > Create New Filter
- Select Include only & traffic to the hostname, and drop in portal.mywebsite.net.

Rinse and repeat for production.
来源:https://stackoverflow.com/questions/24808166/tracking-same-domains-but-different-environments-in-google-analytics