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

.net - Bulk insert via Dapper is slower than inserting rows one-by-one -

shared memory - gstreamer shmsrc and shmsink with h264 data -

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