Since the Google Analytics snippet is available in the source code of the page (e.g. below is stackexchange's)   <script type=text/javascript>var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-5620270-24']);        _gaq.push(['_setDomainName','.stackexchange.com']);        _gaq.push(['_setCustomVar', 2, 'accountid', '148108',2]); _gaq.push(['_trackPageview']);    var _qevents = _qevents || [];    (function(){        var s=document.getElementsByTagName('script')[0];        var ga=document.createElement('script');        ga.type='text/javascript';        ga.async=true;        ga.src='http://www.google-analytics.com/ga.js';        s.parentNode.insertBefore(ga,s);        var sc=document.createElement('script');        sc.type='text/javascript';        sc.async=true;        sc.src='http://edge.quantserve.com/quant.js';         s.parentNode.insertBefore(sc,s);    })();    </script>I was wondering how Google were preventing people's GA accounts from being spammed. For instance I could modify my /etc/hosts file to point webmasters.stackexchange.com to a server of mine, then on that server I create few dummy webpages with the above GA code, and I could use an automated browser like Selenium to continuously browse these pages and execute the GA code which would generate plenty of requests from my browser to GA.How does Google prevent people's GA account statistics from being spammed?
How does Google prevent GA accounts from being spammed
google analytics;spam;spam prevention;hacking;google analytics spam
there currently aren't any safeguards in place, and while uncommon people can spam your account, for example, if they hold a grudge. If you are spammed you cannot remove this data.It is best to put in place a precautionary filter, selecting 'include only' and 'traffic from the domains' and setting this to your domain(s) which you want to be included.