How to exclude traffic in Google Analytics from Dynamic IP addresses?

后端 未结 9 723
执笔经年
执笔经年 2021-02-05 21:04

Google\'s detection of Unusual traffic is nice. But how is it handling Dynamic IP addresses?

For example,I do not have ranges of IPs and my ISP provides Dynamic IP which

9条回答
  •  醉酒成梦
    2021-02-05 21:31

    If you are talking about your own computer/network you have several options:

    • Set up a proxy (Fiddler, or if possible a rule in your router) to block calls to google-analytics.com (the proxy should still return a 200 status code)

    • per Gaurav's answer use the Google extension to block GA (there are versions for all major browsers)

    • set a cookie in the format disable-UA-XXXXXX-X where you replace the X with your property id.

    The first two options will block all Google Analytics tracking on any site, the last will only stop tracking the property specified in the cookie value.

    All of these are IMO better solutions than conditionally including the analytics library. If you have a call to a method from the GA library somewhere in your code and the library isn't loaded this will result in a javascript error. The methods above will at least load a code stub that captures method calls so there are no calls to undefined functions.

提交回复
热议问题