Add javascript to the www/ tree for Google Analytics.

This will also be active on the doc/ tree once we're sure there are no
problems.

PR:		159634
Submitted by:	eadler
This commit is contained in:
Glen Barber 2011-08-15 00:30:17 +00:00
parent 5a3e3c0bc1
commit 5224f14211
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=37554
3 changed files with 27 additions and 3 deletions

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/gifs/Makefile,v 1.53 2005/05/08 15:49:57 murray Exp $
# $FreeBSD: www/en/layout/js/Makefile,v 1.1 2005/10/04 05:49:13 murray Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -7,6 +7,7 @@
.include "../Makefile.inc"
.endif
DATA= styleswitcher.js
DATA= google.js \
styleswitcher.js
.include "${WEB_PREFIX}/share/mk/web.site.mk"

22
en/layout/js/google.js Normal file
View file

@ -0,0 +1,22 @@
/* $FreeBSD$ */
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,
1 // Lets track this by 'visitor' (per cookie). If we need more
// fine grained data we could always change it later
]);
(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);
})();