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 11c3114..94c8129 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>