Merge pull request #15 from bnjbvr/piwik-support

Add support for Piwik
This commit is contained in:
Alexandre Vicenzi 2015-11-21 21:30:28 -02:00
commit ba5405da0e
2 changed files with 19 additions and 0 deletions

View file

@ -17,6 +17,7 @@ A minimalist [Pelican](http://blog.getpelican.com/) theme.
- Disqus
- Google Analytics
- Google Tag Manager
- Piwik
- StatusCake
## Need Docs?

View file

@ -98,5 +98,23 @@
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid={{ ADD_THIS_ID }}" async="async"></script>
{% endif %}
{% block additional_js %}{% endblock %}
{% if PIWIK_URL and PIWIK_SITE_ID %}
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//{{ PIWIK_URL }}/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', {{ PIWIK_SITE_ID }}]);
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>
<noscript><p><img src="//bnjbvr.alwaysdata.net/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
{% endif %}
</body>
</html>