Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Dec 2012 01:43:27 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org
Subject:   svn commit: r40269 - in head: . en_US.ISO8859-1/htdocs/layout/js
Message-ID:  <201212050143.qB51hR3l028770@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Wed Dec  5 01:43:27 2012
New Revision: 40269
URL: http://svnweb.freebsd.org/changeset/doc/40269

Log:
  I maintain the Google Analytics file and must approve changes.
  This should have been here since it was committed.
  
  Implement DNT checks
  
  Make enable/disabling the flip of an obvious switch.
  
  Remove pointless custom variable (it doesn't work anyways)
  
  Fix some style errors
  
  Add a file allowing Google to verify that I "control" freebsd.org
  
  Reviewed by:	doceng (gjb)
  Approved by:	bcr (mentor)

Added:
  head/google6bb24ed0b804d5e9.html   (contents, props changed)
Modified:
  head/en_US.ISO8859-1/htdocs/layout/js/google.js

Modified: head/en_US.ISO8859-1/htdocs/layout/js/google.js
==============================================================================
--- head/en_US.ISO8859-1/htdocs/layout/js/google.js	Tue Dec  4 23:34:04 2012	(r40268)
+++ head/en_US.ISO8859-1/htdocs/layout/js/google.js	Wed Dec  5 01:43:27 2012	(r40269)
@@ -1,13 +1,28 @@
 /* $FreeBSD$ */
 
-//var h=document.location.host;
-var h=null;
+/*
+ * 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 = false;
+var allow_track = true;
+
+var h = document.location.host;
 /*
  * 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/i;
-if (fbsdregex.test(h)) {
+var fbsdregex = /(docs|security|svnweb|wiki|www)\.freebsd\.org/i;
+
+if (window.navigator.doNotTrack === "yes") {
+	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']);
@@ -20,31 +35,8 @@ if (fbsdregex.test(h)) {
 	// This is what we track
 	_gaq.push(['_trackPageview']);
 	_gaq.push(['_trackPageLoadTime']);
-	_gaq.push(['_setCustomVar',
-		/*
-		 * This is the last available 'slot', and can be adjusted
-		 * if needed; 1 through 5 are available, so we can add more
-		 * custom variables if needed.
-		 */
-		5,
-		/*
-		 * This is the custom name to what this custom variable
-		 * will be reported as.
-		 */
-		'Real Operating System',
-		/*
-		 * Try to track what operating systems are used to visit
-		 * the site.
-		 */
-		navigator.platform,
-		/*
-		 * Tracking is done per cookie to try to identify unique
-		 * visitors.
-		 */
-		1
-		]);
 
-	(function() {
+	( function() {
 		var ga = document.createElement('script');
 		ga.type = 'text/javascript';
 		ga.async = true;

Added: head/google6bb24ed0b804d5e9.html
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/google6bb24ed0b804d5e9.html	Wed Dec  5 01:43:27 2012	(r40269)
@@ -0,0 +1 @@
+google-site-verification: google6bb24ed0b804d5e9.html
\ No newline at end of file



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212050143.qB51hR3l028770>