Added piwik integration.
This commit is contained in:
parent
56241557cc
commit
4047401c37
2 changed files with 16 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
{{ block "meta" . }}{{ end }}
|
||||
{{- partialCached "meta.html" . -}}
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID }}{{ partialCached "piwik.html" . }}{{ end -}}
|
||||
</head>
|
||||
|
||||
<body class="{{ if $.Param "sidebar" | default true }}one-sidebar sidebar-second{{ else }}no-sidebars{{ end }}">
|
||||
|
|
|
|||
12
layouts/partials/piwik.html
Normal file
12
layouts/partials/piwik.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//{{ .Site.Params.piwikTrackerUrl }}/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', '{{ .Site.Params.piwikSiteID }}']);
|
||||
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>
|
||||
Loading…
Reference in a new issue