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

r - geom_bar tied exactly to x and y axis (without aggregating) -

php - Is there a way to specify only some optional function args? -

java - Spring-boot using RestTemplate -