summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFederico Bruni <fede@inventati.org>2016-03-25 14:54:20 +0100
committerFederico Bruni <fede@inventati.org>2016-04-07 11:03:00 +0200
commit9580a231b3d3f912f46066009114a2929ecbb16a (patch)
tree6d4cdb7f0a0f61fcfd3c357dc265d13b8b29d4d7 /scripts
parente0808cc5f4890c5f8f03ed1be48fc911627afea4 (diff)
issue 4813: replace urchin.js with analytics.js and fix redundant hostnames
This patch aims at fixing two warnings reported by Google Analytics: 1. analytics.js is the new javascript library which replaces urchin.js 2. the website should be available at one hostname only and we chose lilypond.org over www.lilypond.org
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/website_post.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/build/website_post.py b/scripts/build/website_post.py
index a6fafdc012..9fba75445f 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