Moving logic inside matomo partial.

This commit is contained in:
Fredrik Jonsson 2019-07-09 22:54:58 +02:00
commit c00bb6187d
2 changed files with 3 additions and 1 deletions

View file

@ -9,7 +9,7 @@
{{- block "head" . }}{{ end }} {{- block "head" . }}{{ end }}
{{ partial "meta_json_ld.html" . }} {{ partial "meta_json_ld.html" . }}
{{ partial "scripts.html" . }} {{ partial "scripts.html" . }}
{{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID }}{{ partialCached "matomo.html" . }}{{ end -}} {{ partialCached "matomo.html" . }}
</head> </head>
<body> <body>

View file

@ -1,3 +1,4 @@
{{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID -}}
<script> <script>
var _paq = window._paq || []; var _paq = window._paq || [];
_paq.push(['trackPageView']); _paq.push(['trackPageView']);
@ -10,3 +11,4 @@
g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})(); })();
</script> </script>
{{ end -}}