diff options
Diffstat (limited to 'gum')
-rw-r--r-- | gum/README.md | 9 | ||||
-rw-r--r-- | gum/templates/base.html | 17 |
2 files changed, 24 insertions, 2 deletions
diff --git a/gum/README.md b/gum/README.md index 41db49d..ffaefb3 100644 --- a/gum/README.md +++ b/gum/README.md @@ -24,6 +24,15 @@ GOOGLE_ANALYTICS_ID = '' GOOGLE_ANALYTICS_SITENAME = '' ``` +Alternatively you can use [Piwik](http://piwik.org/) for analytics if you set the following settings, where the url has to be given without leading `http://` and trailing `/`. + +``` +PIWIK_ID = '' +PIWIK_URL = '' +``` + + + ### Screenshot ### diff --git a/gum/templates/base.html b/gum/templates/base.html index af0f3d8..55feaaa 100644 --- a/gum/templates/base.html +++ b/gum/templates/base.html @@ -54,8 +54,21 @@ </script> {% endif %} - - + {% if PIWIK_URL%} + <script type="text/javascript"> + var _paq = _paq || []; + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u=(("https:" == document.location.protocol) ? "https" : "http") + "://{{ PIWIK_URL }}/"; + _paq.push(['setTrackerUrl', u+'piwik.php']); + _paq.push(['setSiteId', {{ PIWIK_ID }}]); + 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><p><img src="http://{{ PIWIK_URL }}/piwik.php?idsite={{ PIWIK_ID }}" style="border:0;" alt="" /></p></noscript> + {% endif %} {% endblock head %} </head> |