Skip to content

Instantly share code, notes, and snippets.

Created May 31, 2011 12:11
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save aronwoost/1000402 to your computer and use it in GitHub Desktop.
Exclude private ip addresses from google analytics tracking
var re = /(^127\.0\.0\.1)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|localhost/;
if(re.test(window.location.hostname)) return;
var _gaq=[['_setAccount','UA-23156659-1'],['_trackPageview'],['_trackPageLoadTime']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment