Prevent Google analytics from gathering data in development environment, ASP.NET MVC

后端 未结 4 1407
情书的邮戳
情书的邮戳 2021-02-09 07:34

I have an ASP.NET MVC (3) app and I\'ve set Google analytics up. The problem is that every time I run from Visual Studio the Google script starts gathering data, which of course

4条回答
  •  忘掉有多难
    2021-02-09 08:29

    The best-practice advised by Google is to use a filter to remove the data from your GA profiles. This can either be done by filtering based on the IP address of development machines or by setting a custom variable cookie in each browser being used for development and testing. This approach would mean you could remove the data without needing to modify your main body of code.

提交回复
热议问题