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:
parent
8b5b159fb2
commit
49fd6cb456
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=37560
1 changed files with 27 additions and 19 deletions
|
|
@ -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);
|
||||
})();
|
||||
})();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue