Merge pull request #102 from badele/piwik

Add piwik analytics tool
This commit is contained in:
Michael Romero 2017-12-27 23:12:16 -08:00 committed by GitHub
commit 2dfcafb7bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,4 +84,27 @@
</script> </script>
{{ end }} {{ end }}
{{ if .Site.Params.piwik }}
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://{{ .Site.Params.piwik.server }}/";
_paq.push(["setTrackerUrl", u+"piwik.php"]);
_paq.push(["setSiteId", "{{ .Site.Params.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>
<!-- Piwik Image Tracker -->
<img src="http://{{ .Site.Params.piwik.server }}/piwik.php?idsite={{ .Site.Params.piwik.id }}&amp;rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<!-- End Piwik Code -->
{{ end }}
{{- partial "footer_custom.html" . }} {{- partial "footer_custom.html" . }}