Can I use the same Google Analytics tag for a blog

2019-05-04 18:43发布

问题:

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.