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