]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Add Piwik analytics.
authorAnt Zucaro <azucaro@gmail.com>
Sun, 22 Oct 2017 17:46:17 +0000 (13:46 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 22 Oct 2017 17:46:17 +0000 (13:46 -0400)
xonstat/templates/base.mako

index 11c3114c1ff7f1a17b92c978131df64b7f7ac4e4..94c8129694d49a1de1af448bcd78b57e3e0873f0 100644 (file)
 
     <%block name="headjs">
       <script src="/static/js/vendor/modernizr.js"></script>
+
+      <!-- Piwik -->
+      <script type="text/javascript">
+        var _paq = _paq || [];
+        /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
+        _paq.push(['trackPageView']);
+        _paq.push(['enableLinkTracking']);
+        (function() {
+          var u="//analytics.xonotic.org/";
+          _paq.push(['setTrackerUrl', u+'piwik.php']);
+          _paq.push(['setSiteId', '2']);
+          var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
+          g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
+        })();
+      </script>
     </%block>
   </head>