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

后端 未结 22 1844
终归单人心
终归单人心 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:37

    I have a PHP variable set for my local development that gives me a terminal for providing data/feedback etc when I'm working on stuff.

    I use XAMPP so that has an env variable for tmp which is the following:

    $isLocal = (getenv("tmp") == '\xampp\tmp') ? true : false;
    

    This doesn't exist on my production server because xampp is not being used

    if($isLocal){
      // do something, eg. load my terminal
    }
    

    ... Specific to this question:

    
      
    
    

提交回复
热议问题