Can I use the same Google Analytics tag for a blog subdomain of my site as the main site?

血红的双手。 提交于 2019-12-07 10:58:34

问题


I have my site.com and blog.mysite.com on a different IP address. Can I use the same Google analytics ID for both sites? Does Google analytics look at what IP address the recorded visitor information is from? If it doesn't, what prevents random sites from including your Google analytics tag and sending random data to your account?


回答1:


You have to modify your script tag a little. Google's FAQs cover this: http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55524




回答2:


You can run any UA-XXXXX-YY on any website (any domain name, on any IP), it will end in your profile stats.

Yes, your stats could get completely messed up if some site would put your UA id on its site.

To prevent this, you can setup an include filter on your GA profiles, and Include only your domain names by using a regep like this "www.domain1.com|www.domain2.com|www.domain2.com" on the hostname field.

Be careful, the Include filter is exclusive (If you have 3 Include filters on the field hostname, only the first one will be applied).

The alternative is to create an advanced segment based on the hostname, you'll get mostly the same result but could be exposed to data sampling effects if you have a large audience. But it allows a quick fix afterwards, while filters need to be set before you get into trouble.




回答3:


Sure. you can use the same for both. You will be able to segment traffic by domain name.



来源:https://stackoverflow.com/questions/533835/can-i-use-the-same-google-analytics-tag-for-a-blog-subdomain-of-my-site-as-the-m

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!