Skip to content

Instantly share code, notes, and snippets.

@cdalsass
Created March 23, 2015 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdalsass/906f000969a519383b0b to your computer and use it in GitHub Desktop.
Save cdalsass/906f000969a519383b0b to your computer and use it in GitHub Desktop.
Statcounter Ajax Script
var sc_project= "XXXXXX";
var sc_invisible = 1;
var sc_security= "XXXXXX";
// got this from here http://forum.statcounter.com/vb/archive/index.php/t-25668.html
var sc_partition = 0;
var scrWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
var sc_server = sc_partition + 1;
var currentURL = encodeURIComponent(window.location.href);
var referrer = encodeURIComponent(document.referrer);
var java = "1";
var title = encodeURIComponent(document.title);
var thisToken = Math.random();
// not sure what these are
var sc_snum=1;
var p=0;
var u1 = "na";
url = "http://c" + sc_server + ".statcounter.com/t.php?sc_project=" + sc_project + "&resolution=" + scrWidth + "&camefrom=" + referrer + "&u=" + currentURL + "&t=" + title + "&java=" + java + "&security=" + sc_security + "&invisible=" + sc_invisible + "&sc_random=" + thisToken + "&sc_snum=" + sc_snum + '&p=' + p + "&h=" + h + "&u1=" + u1;
//console.log(url);
img = new Image(0,0);
img.src = url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment