Skip to content

Instantly share code, notes, and snippets.

@specific-dad
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save specific-dad/8f7c222976ee04a82930 to your computer and use it in GitHub Desktop.

Select an option

Save specific-dad/8f7c222976ee04a82930 to your computer and use it in GitHub Desktop.
function gag(tid,dh,dp,cn) {
var guid = (function() {
function s4() { return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); }
return function() { return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); };
})();
var uuid = guid();
var url = "http://www.google-analytics.com/collect?v=1&t=pageview&dr="+encodeURIComponent(window.location)+
"&tid="+encodeURIComponent(tid)+
"&cid="+encodeURIComponent(uuid)+
"&dh="+encodeURIComponent(dh)+
"&dp="+encodeURIComponent(dp)+
"&dl="+encodeURIComponent("http://"+dh+dp)+
"&cn="+encodeURIComponent(cn);
var img = new Image();
img.src = url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment