culinary.kemonine.info/themes/hugo-theme-techdoc/layouts/partials/meta/google-analytics-async.html
2022-12-03 10:27:03 -05:00

16 lines
506 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{- if .Site.IsServer -}}
<!-- only production, not generate Google Analytics with Hugos built-in server -->
{{- else -}}
{{- with .Site.Params.google_analytics_id -}}
<!-- BEGIN: Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ . }}');
</script>
<!-- END: Google Analytics -->
{{- end -}}
{{- end -}}