2020-04-22 11:50:30 +02:00
|
|
|
{{- if .enable -}}
|
|
|
|
{{- /* Google Analytics */ -}}
|
|
|
|
{{- with .google.id -}}
|
|
|
|
<script type="text/javascript">
|
2020-05-12 14:51:07 +02:00
|
|
|
window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());
|
|
|
|
gtag('config', '{{ . }}'{{ if $.google.anonymizeIP }}, { 'anonymize_ip': true }{{ end }});
|
2020-04-22 11:50:30 +02:00
|
|
|
</script>
|
2020-05-12 14:51:07 +02:00
|
|
|
{{- printf "https://www.googletagmanager.com/gtag/js?id=%s" . | dict "async" true "source" | partial "plugin/script.html" -}}
|
2020-04-22 11:50:30 +02:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- /* Fathom Analytics */ -}}
|
|
|
|
{{- with .fathom.id -}}
|
|
|
|
<script type="text/javascript">
|
2020-05-12 14:51:07 +02:00
|
|
|
window.fathom=window.fathom||function(){(fathom.q=fathom.q||[]).push(arguments);};
|
2020-04-22 11:50:30 +02:00
|
|
|
fathom('set', 'siteId', '{{ . }}');
|
|
|
|
fathom('trackPageview');
|
|
|
|
</script>
|
|
|
|
{{- dict "source" ($.fathom.server | default "cdn.usefathom.com" | printf "https://%s/tracker.js") "async" true "attr" "id=fathom-script" | partial "plugin/script.html" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|