Adds Matomo (aka Piwik) integration (#310)
* adds Matomo (aka Pwiki) integration * adds tracking code in header
This commit is contained in:
parent
0ff0c5ad6b
commit
7677fbd01a
4 changed files with 46 additions and 4 deletions
17
_includes/matomo.html
Normal file
17
_includes/matomo.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
{% if site.matomo %}
|
||||
<!-- Matomo -->
|
||||
<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="//{{- site.matomo.uri -}}/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', '{{- site.matomo.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>
|
||||
<!-- End Piwik Code -->
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue