2024-04-28 17:33:09 +02:00
|
|
|
{{ if isset site.Params.umamiAnalytics "domain" }}
|
2024-07-15 22:27:55 +02:00
|
|
|
<script data-id="umami-script" async
|
|
|
|
src="https://{{ site.Params.umamiAnalytics.domain }}/script.js"
|
|
|
|
data-website-id="{{ site.Params.umamiAnalytics.websiteid }}"
|
|
|
|
{{ with site.Params.umamiAnalytics.dataDomains }}data-domains="{{ . }}"{{ end }}>
|
2024-04-28 17:33:09 +02:00
|
|
|
</script>
|
|
|
|
{{ else }}
|
2024-07-15 22:27:55 +02:00
|
|
|
<script data-id="umami-script" async src="https://analytics.umami.is/script.js"
|
|
|
|
data-website-id="{{ site.Params.umamiAnalytics.websiteid }}">
|
2024-04-28 17:33:09 +02:00
|
|
|
</script>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2024-07-15 22:27:55 +02:00
|
|
|
document.querySelector('script[data-id="umami-script"]')
|
|
|
|
.addEventListener('load', function () {
|
|
|
|
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute('content');
|
|
|
|
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute('content');
|
|
|
|
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
|
|
|
|
umami.track(type + ':' + title, {'url': url});
|
2024-04-28 17:33:09 +02:00
|
|
|
});
|
|
|
|
</script>
|