Browse Source

Add piwik support

master
Schneider 8 years ago
parent
commit
e17728588f
  1. 18
      layouts/partials/js.html

18
layouts/partials/js.html

@ -2,3 +2,21 @@
<script src="{{ $.Site.BaseURL }}{{ . }}"></script> <script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{ end }} {{ end }}
{{ with .Site.Params.Piwik }}
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDoNotTrack", true]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://{{ .siteurl }}/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '{{ .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="https://{{ .siteurl }}/piwik.php?idsite={{ .id }}&rec=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
{{ end }}
Loading…
Cancel
Save