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.
you have possibility filter in analytics, option jungle in analytics bit confusing in opinion.
you can in javascript:
if (window.location.hostname != 'localhost' && window.location.hostname != '127.0.0.1') { //put analytics here }
Comments
Post a Comment