Add support for Plausible analytics.
This commit is contained in:
parent
0c1c307f1c
commit
141f2f7b6d
2 changed files with 6 additions and 0 deletions
|
|
@ -184,6 +184,8 @@ params:
|
|||
mobileMenu: true # Turn on a mobile menu on small screens.
|
||||
piwikSiteId: # Matamo site id
|
||||
piwikTrackerUrl: "" # Matamo url, schemaless and no slash on end (example.org/matamo).
|
||||
plausibleSiteID: "" # Plausible site id/domain.
|
||||
plausibleTrackerURL: "" # Plausible url, schemaless and no slash on end. Optional, defaults to "plausible.io/…"
|
||||
poweredby: true # Show powered by hugo in footer
|
||||
privacyPolicyUrl: "" # If set will add link to cookie consent form.
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@
|
|||
<script defer src="https://{{ .Site.Params.piwikTrackerUrl }}/matomo.js"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if .Site.Params.plausibleSiteID -}}
|
||||
<script async defer data-domain="{{ .Site.Params.plausibleSiteID }}" src="{{ .Site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if .Site.GoogleAnalytics -}}
|
||||
{{ $script := resources.Get "js/tracking.js" | resources.ExecuteAsTemplate "js/tracking.js" . | minify | fingerprint -}}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue