diff --git a/en_US.ISO8859-1/htdocs/layout/Makefile b/en_US.ISO8859-1/htdocs/layout/Makefile index e468f29618..642cb64803 100644 --- a/en_US.ISO8859-1/htdocs/layout/Makefile +++ b/en_US.ISO8859-1/htdocs/layout/Makefile @@ -9,6 +9,5 @@ SUBDIR= css SUBDIR+= images -SUBDIR+= js .include "${DOC_PREFIX}/share/mk/web.site.mk" diff --git a/en_US.ISO8859-1/htdocs/layout/js/Makefile b/en_US.ISO8859-1/htdocs/layout/js/Makefile deleted file mode 100644 index 44396793aa..0000000000 --- a/en_US.ISO8859-1/htdocs/layout/js/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# $FreeBSD$ - -.if exists(../Makefile.conf) -.include "../Makefile.conf" -.endif -.if exists(../Makefile.inc) -.include "../Makefile.inc" -.endif - -DATA= google.js - -.include "${DOC_PREFIX}/share/mk/web.site.mk" diff --git a/en_US.ISO8859-1/htdocs/layout/js/google.js b/en_US.ISO8859-1/htdocs/layout/js/google.js deleted file mode 100644 index d6aac94338..0000000000 --- a/en_US.ISO8859-1/htdocs/layout/js/google.js +++ /dev/null @@ -1,52 +0,0 @@ -/* $FreeBSD$ */ - -/* - * Please do not commit to this file without receiving review from - * webstats@FreeBSD.org. - */ - -/* Teach jslint the appropriate style rules. */ -/*jslint browser:true*/ - -var enable_ga = true; -var allow_track = true; - -var h = document.location.hostname; -/* - * Check that the hosting domain is actually a FreeBSD.org domain, so - * we don't accidentally obtain data from mirrors. - */ -var fbsdregex = /((docs|security|svnweb|wiki|www)\.freebsd\.org|google\.com)$/i; - -if (typeof navigator.doNotTrack !== "undefined" && (navigator.doNotTrack == "yes" || navigator.doNotTrack == "1")) { - allow_track = false; -} - -if (enable_ga && allow_track && fbsdregex.test(h)) { - var _gaq = _gaq || []; - _gaq.push(['_setAccount', 'UA-22767463-1']); - _gaq.push(['_setDomainName', 'freebsd.org']); - _gaq.push(['_setAllowHash', false]); - _gaq.push (['_gat._anonymizeIp']); - - /* - * If we ever want to track sites other than FreeBSD.org, - * uncomment the next line. - */ - //_gaq.push(['_setAllowLinker', true]); - // This is what we track - _gaq.push(['_trackPageview']); - _gaq.push(['_trackPageLoadTime']); - - ( 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); - - })(); - -} - diff --git a/share/xml/header.ent b/share/xml/header.ent index 93c97b5fb5..5f66c465e3 100644 --- a/share/xml/header.ent +++ b/share/xml/header.ent @@ -21,10 +21,33 @@ + '> + +var allow_track = true; var h = document.location.hostname; +var fbsdregex = /((docs|security|svnweb|wiki|www)\.freebsd\.org|google\.com)$/i; + +if (typeof navigator.doNotTrack !== 'undefined' && (navigator.doNotTrack == '1')) { + allow_track = false; +} +if (allow_track && fbsdregex.test(h)) { +(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': +new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], +j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= +'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); +})(window,document,'script','dataLayer','GTM-PXRWZVR');} +"> + +'> ]]> + Header And Logo'> diff --git a/share/xml/xhtml.xsl b/share/xml/xhtml.xsl index d37badfdb0..88bc1196e1 100644 --- a/share/xml/xhtml.xsl +++ b/share/xml/xhtml.xsl @@ -49,6 +49,7 @@
+ &header1.googleiframe;