javascript - How to prevent google analytics from getting traffic from localhost? -


i have issue. use google analytics in small project, , develop on localhost. of course call site again , again on local machine, pullutes analytics stats. can do?

thats quit simple.

  1. you have possibility filter in analytics, option jungle in analytics bit confusing in opinion.

  2. you can in javascript:

    if (window.location.hostname != 'localhost' && window.location.hostname != '127.0.0.1') {     //put analytics here     } 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -