diff rhodecode/templates/base/base.html @ 890:042d38683d42 beta

implemented #89 google analytics code
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 29 Dec 2010 10:39:46 +0100
parents 3025b0f9475e
children 1294f2baf2bc
line wrap: on
line diff
--- a/rhodecode/templates/base/base.html	Wed Dec 29 01:51:29 2010 +0100
+++ b/rhodecode/templates/base/base.html	Wed Dec 29 10:39:46 2010 +0100
@@ -10,6 +10,22 @@
     ${self.css()}
     <!-- scripts -->
     ${self.js()}
+%if c.ga_code:
+<script type="text/javascript">
+
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', '${c.ga_code}']);
+  _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);
+  })();
+
+
+</script>
+%endif
 </head>
 <body>
     <!-- header -->