From owner-svn-doc-head@FreeBSD.ORG Wed Dec 5 01:43:28 2012 Return-Path: Delivered-To: svn-doc-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B24A93F; Wed, 5 Dec 2012 01:43:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F39468FC08; Wed, 5 Dec 2012 01:43:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB51hRn2028772; Wed, 5 Dec 2012 01:43:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB51hR3l028770; Wed, 5 Dec 2012 01:43:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212050143.qB51hR3l028770@svn.freebsd.org> From: Eitan Adler Date: Wed, 5 Dec 2012 01:43:27 +0000 (UTC) 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 X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Dec 2012 01:43:28 -0000 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