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

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinh T. Tô <31973230+linhtto@users.noreply.github.com>2022-09-06 03:13:27 +0300
committerGitHub <noreply@github.com>2022-09-06 03:13:27 +0300
commite7e8344a512c12c02bd7bc8875067af8f737069a (patch)
tree6a88bb63943a2484e0785818688a21822eaf3898
parent591eb5ab070c474f884295369c55fcda15883959 (diff)
Use new Google Analytics template to accommodate both GA4 and GS3 in header (#341)
-rw-r--r--README.md2
-rw-r--r--layouts/404.html2
-rw-r--r--layouts/partials/footer/scripts.html2
-rw-r--r--layouts/partials/head/metadata.html3
4 files changed, 6 insertions, 3 deletions
diff --git a/README.md b/README.md
index 6ca2dbe..36271b4 100644
--- a/README.md
+++ b/README.md
@@ -189,7 +189,7 @@ You can easily use Plausible.io for analytics by setting `plausible = true` in y
## Google Analytics
-Set `googleAnalytics` in `config.toml` to activate Hugo's [internal Google Analytics template](https://gohugo.io/templates/internal/#google-analytics).
+Set `googleAnalytics` in `config.toml` to activate Hugo's [internal Google Analytics template](https://gohugo.io/templates/internal/#google-analytics). This supports both Google Analytics 3 (Universal Analytics) and Google Analytics 4. Google Analytics 3 tracking id is of the form 'UA-PROPERTY_ID', and Google Analytics 4 tracking is of the form 'G-MEASUREMENT_ID'.
## Disqus
diff --git a/layouts/404.html b/layouts/404.html
index a4f98ab..9c04cf4 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -1,3 +1,5 @@
+{{ partial "head/metadata.html" . }}
+
{{ define "title" }}
<h1 class="bold-title is-1">{{ i18n "404_title" . }}</h1>
{{ end }}
diff --git a/layouts/partials/footer/scripts.html b/layouts/partials/footer/scripts.html
index f4dc641..bdf93a9 100644
--- a/layouts/partials/footer/scripts.html
+++ b/layouts/partials/footer/scripts.html
@@ -3,8 +3,6 @@
{{ $scripts := slice $jQuery $index | resources.Concat "js/bundle.js" | fingerprint }}
<script src="{{ $scripts.Permalink }}" integrity="{{ $scripts.Data.Integrity }}"></script>
-{{ template "_internal/google_analytics_async.html" . }}
-
<!-- Custom JavaScript -->
{{ range .Site.Params.customJS -}}
{{ $script := resources.Get . | minify }}
diff --git a/layouts/partials/head/metadata.html b/layouts/partials/head/metadata.html
index fc624d2..74efa54 100644
--- a/layouts/partials/head/metadata.html
+++ b/layouts/partials/head/metadata.html
@@ -1,3 +1,6 @@
+{{ template "_internal/google_analytics.html" . }}
+
+
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="HandheldFriendly" content="True">