Is there a way to stop Google Analytics counting development work as hits?

后端 未结 22 1772
终归单人心
终归单人心 2020-12-02 04:51

I have added the JavaScript that I need to the bottom of my pages so that I can make use of Google Analytics. Only problem is that I am sure that it is counting all my devel

22条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 05:27

    Add this line before your Google Analytics async code runs to disable tracking for that web property ID:

    window['ga-disable-UA-XXXXXX-Y'] = true;
    

    UA-XXXXXX-Y corresponds to the web property ID on which you would like to disable tracking.

    From: https://developers.google.com/analytics/devguides/collection/gajs/

提交回复
热议问题