From b2d6b8229df9902481a431df62c6711bad8debfb Mon Sep 17 00:00:00 2001
From: Christoph Groth <christoph.groth@cea.fr>
Date: Mon, 14 Dec 2015 10:21:02 +0800
Subject: [PATCH] doc: add piwik code (triggerable through CLI)

Co-authored by Anton Akhmerov <anton.akhmerov@gmail.com>
---
 doc/templates/layout.html | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/doc/templates/layout.html b/doc/templates/layout.html
index 781a09fa..ce31adb9 100644
--- a/doc/templates/layout.html
+++ b/doc/templates/layout.html
@@ -209,5 +209,25 @@
     {%- endif %}
     </div>
 {%- endblock %}
+{%- if website_deploy %}    
+    <!-- Piwik -->
+    <script type="text/javascript">
+      var _paq = _paq || [];
+      _paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
+      _paq.push(["setCookieDomain", "*.kwant-project.org"]);
+      _paq.push(["trackPageView"]);
+      _paq.push(["enableLinkTracking"]);
+
+      (function() {
+      var u=(("https:" == document.location.protocol) ? "https" : "http") + "://piwik.kwant-project.org/";
+      _paq.push(["setTrackerUrl", u+"piwik.php"]);
+      _paq.push(["setSiteId", "1"]);
+      var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
+      g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
+      })();
+    </script>
+    <noscript><img src="http://piwik.kwant-project.org/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" /></noscript>
+    <!-- End Piwik Code: Analytics are used by us to improve the site, and not sent to anyone. -->
+{%- endif %}
   </body>
 </html>
-- 
GitLab