diff --git a/site/layouts/partials/google-analytics.html b/site/layouts/partials/google-analytics.html
new file mode 100644
index 000000000..c85bdbc70
--- /dev/null
+++ b/site/layouts/partials/google-analytics.html
@@ -0,0 +1,19 @@
+{{/*
+ Google Analytics 4 (gtag.js).
+
+ Renders only in production builds (Netlify runs `hugo` with the production
+ environment, so local `hugo server` and PR previews stay out of the data).
+ The Measurement ID is read from `params.googleAnalytics` in config.yaml.
+*/}}
+{{ if hugo.IsProduction }}
+{{ with .Site.Params.googleAnalytics }}
+
+
+
+{{ end }}
+{{ end }}
diff --git a/site/layouts/partials/head-docs.html b/site/layouts/partials/head-docs.html
index c92837b2f..8cbb917ed 100644
--- a/site/layouts/partials/head-docs.html
+++ b/site/layouts/partials/head-docs.html
@@ -8,4 +8,5 @@
{{ $styles := resources.Get "styles.scss" | toCSS $options | resources.Fingerprint }}
{{/* TODO {% seo %}*/}}
+ {{ partial "google-analytics.html" . }}