Reneme matomo partial to tracking since we have added Google analytic support.

This commit is contained in:
Fredrik Jonsson 2020-08-10 11:32:25 +02:00
commit 695d22015f
3 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,6 @@
/**
* @file
* A JavaScript file for matomo analytic tracking.
* A JavaScript file for analytic tracking.
*/
var idSite = {{ .Site.Params.piwikSiteID }};

View file

@ -9,7 +9,7 @@
{{- block "head" . }}{{ end }}
{{ partial "meta_json_ld.html" . }}
{{ partial "scripts.html" . }}
{{ partialCached "matomo.html" . }}
{{ partialCached "tracking.html" . }}
</head>
<body class="{{ if .IsPage }}single-page{{ else }}list-page{{ end }}{{ if .IsHome }} front{{ end }}">

View file

@ -0,0 +1,11 @@
{{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID -}}
{{ $script := resources.Get "js/tracking.js" | resources.ExecuteAsTemplate "js/tracking.js" . | minify | fingerprint -}}
<script src="{{ $script.RelPermalink }}"></script>
<script defer src="https://{{ .Site.Params.piwikTrackerUrl }}/matomo.js"></script>
{{ end -}}
{{ if .Site.GoogleAnalytics -}}
{{ $script := resources.Get "js/tracking.js" | resources.ExecuteAsTemplate "js/tracking.js" . | minify | fingerprint -}}
<script src="{{ $script.RelPermalink }}"></script>
<script defer src="https://ssl.google-analytics.com/ga.js"></script>
{{ end -}}