Check that the hosting domain is actually a FreeBSD.org domain, so

we don't accidentally obtain data from mirrors.

Submitted by:		eadler (via email)
This commit is contained in:
Glen Barber 2011-08-16 23:19:35 +00:00
parent 8b5b159fb2
commit 49fd6cb456
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=37560

View file

@ -1,9 +1,15 @@
/* $FreeBSD$ */
/* $FreeBSD: www/en/layout/js/google.js,v 1.1 2011/08/15 00:30:17 gjb Exp $ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22767463-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_setCustomVar',
h=document.location.host;
/*
* Check that the hosting domain is actually a FreeBSD.org domain, so
* we don't accidentally obtain data from mirrors.
*/
if (h == "www.freebsd.org" || h == "freebsd.org" || h == "wiki.freebsd.org") {
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22767463-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_setCustomVar',
5, // use the last index in case we just don't care ;-)
'Real Operating System',
navigator.platform,
@ -11,12 +17,14 @@ _gaq.push(['_setCustomVar',
// fine grained data we could always change it later
]);
(function() {
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = 'https://ssl.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
})();
}