Changeset View
Changeset View
Standalone View
Standalone View
website/themes/beastie/static/js/google.js
Show All 10 Lines | |||||
var enable_ga = true; | var enable_ga = true; | ||||
var allow_track = true; | var allow_track = true; | ||||
var h = document.location.hostname; | var h = document.location.hostname; | ||||
/* | /* | ||||
* Check that the hosting domain is actually a FreeBSD.org domain, so | * Check that the hosting domain is actually a FreeBSD.org domain, so | ||||
* we don't accidentally obtain data from mirrors. | * we don't accidentally obtain data from mirrors. | ||||
*/ | */ | ||||
var fbsdregex = /((docs|security|svnweb|wiki|www)\.freebsd\.org|google\.com)$/i; | var fbsdregex = /((docs|security|svnweb|cgit|wiki|www)\.freebsd\.org|google\.com)$/i; | ||||
if (typeof navigator.doNotTrack !== "undefined" && (navigator.doNotTrack == "yes" || navigator.doNotTrack == "1")) { | if (typeof navigator.doNotTrack !== "undefined" && (navigator.doNotTrack == "yes" || navigator.doNotTrack == "1")) { | ||||
allow_track = false; | allow_track = false; | ||||
} | } | ||||
if (enable_ga && allow_track && fbsdregex.test(h)) { | if (enable_ga && allow_track && fbsdregex.test(h)) { | ||||
var _gaq = _gaq || []; | var _gaq = _gaq || []; | ||||
_gaq.push(['_setAccount', 'UA-22767463-1']); | _gaq.push(['_setAccount', 'UA-22767463-1']); | ||||
Show All 25 Lines |