Welcome to mirror list, hosted at ThFree Co, Russian Federation.

google-analytics.html « partials « layouts - github.com/zerostaticthemes/hugo-serif-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8a58a62c7e6ab5d2f053d440c7702cd7f6e0aaca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{{- if and (not .Site.IsServer) hugo.IsProduction -}}
{{ with getenv "HUGO_GOOGLE_ANALYTICS_ID" | default .Site.Params.google_analytics_id }}
<!-- Global site tag (gtag.js) - 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 }}
{{ end }}