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

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -