]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Add Google Analytics support.
authorAnt Zucaro <azucaro@gmail.com>
Tue, 27 Mar 2012 21:23:53 +0000 (17:23 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Tue, 27 Mar 2012 21:23:53 +0000 (17:23 -0400)
Stats has been operational for almost six months now, yet I don't have a clue of how many people are using/visiting the site on a daily basis. It's time to fix that! GA support will be tracked up to the xonstat address at gmail.com.

xonstat/templates/base.mako

index c421da7cf74f791e51adf53f1fcc61975827e3eb..53246f520575e85dcc5c0f75c623a102f97285c2 100755 (executable)
 
       <%block name="js">
       </%block>
+
+      <script type="text/javascript">
+      var _gaq = _gaq || [];
+      _gaq.push(['_setAccount', 'UA-30391685-1']);
+      _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>
+
     </body>
 </html>