From d4f565fb3012150011ab3fb32126d1cdf21c4c44 Mon Sep 17 00:00:00 2001 From: Heather Miller Date: Thu, 8 Mar 2012 21:28:37 +0100 Subject: [PATCH] Adds google analytics to the docs that will go on akka.io. --- akka-docs/_sphinx/themes/akka/layout.html | 1 + akka-docs/_sphinx/themes/akka/static/ga.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 akka-docs/_sphinx/themes/akka/static/ga.js diff --git a/akka-docs/_sphinx/themes/akka/layout.html b/akka-docs/_sphinx/themes/akka/layout.html index c932264b8a..6f975aad81 100644 --- a/akka-docs/_sphinx/themes/akka/layout.html +++ b/akka-docs/_sphinx/themes/akka/layout.html @@ -11,6 +11,7 @@ {% set script_files = script_files + ['_static/effects.highlight.js'] %} {% set script_files = script_files + ['_static/scrollTo.js'] %} {% set script_files = script_files + ['_static/contentsFix.js'] %} +{% set script_files = script_files + ['_static/ga.js'] %} {% set css_files = css_files + ['_static/prettify.css'] %} {% set css_files = css_files + ['_static/base.css'] %} {% set css_files = css_files + ['_static/docs.css'] %} diff --git a/akka-docs/_sphinx/themes/akka/static/ga.js b/akka-docs/_sphinx/themes/akka/static/ga.js new file mode 100644 index 0000000000..6fed9c200c --- /dev/null +++ b/akka-docs/_sphinx/themes/akka/static/ga.js @@ -0,0 +1,13 @@ +// check to see if this document is on the akka.io server. If so, google analytics. +if (/akka\.io/.test(document.domain)) { + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-21117439-1']); + _gaq.push(['_setDomainName', 'akka.io']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); +} \ No newline at end of file