lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

issue 4813: replace urchin.js with analytics.js and fix redundant hostna


From: fedelogy
Subject: issue 4813: replace urchin.js with analytics.js and fix redundant hostnames (issue 294020043 by address@hidden)
Date: Wed, 30 Mar 2016 07:23:29 +0000

Reviewers: ,

Message:
The change to the htaccess file should be tested manually on the server
before pushing this patch to staging.

Description:
issue 4813: replace urchin.js with analytics.js and fix redundant
hostnames

The change to the htaccess file should be tested manually on the server
before pushing this patch to staging.

Please review this at https://codereview.appspot.com/294020043/

Affected files (+13, -6 lines):
  M Documentation/web/server/lilypond.org.htaccess
  M scripts/build/website_post.py


Index: Documentation/web/server/lilypond.org.htaccess
diff --git a/Documentation/web/server/lilypond.org.htaccess b/Documentation/web/server/lilypond.org.htaccess index c6da26a1bb1ac2d54cd91f32baacc1a6459e1927..20c58651efe766e9098caf4277a3cfe2547c9b11 100644
--- a/Documentation/web/server/lilypond.org.htaccess
+++ b/Documentation/web/server/lilypond.org.htaccess
@@ -16,6 +16,10 @@

 RewriteEngine On

+# Permanent redirect from www.lilypond.org to lilypond.org
+RewriteCond "%{HTTP_HOST}" "^www\." [NC]
+RewriteRule "^/?(.*)"      "http://%{HTTP_HOST}/$1"; [L,R=301,NE]
+
 # Deny following of symlinks by robots.
 # HTTrack is a known offender.
 # better yet, to redirect this to page that tells adminstrator
Index: scripts/build/website_post.py
diff --git a/scripts/build/website_post.py b/scripts/build/website_post.py
index a6fafdc01251bb38559f84d2dc3c337855881029..9fba75445fd86e0e219fc52a2ba60764972cf495 100644
--- a/scripts/build/website_post.py
+++ b/scripts/build/website_post.py
@@ -198,12 +198,15 @@ for file in html_files:
         ### add google tracker header
         if (line.find("</head>") >= 0):
             outfile.write("""<!-- Google tracking !-->
-<script src="http://www.google-analytics.com/urchin.js";
-type="text/javascript">
-</script>
-<script type="text/javascript">
-_uacct = "UA-68969-1";
-urchinTracker();
+<script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]|| function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-68969-1', 'auto');
+  ga('send', 'pageview');
+
 </script>
 """);
         #### add google tracker goals





reply via email to

[Prev in Thread] Current Thread [Next in Thread]