From 1977065ba3aecc9536ae1cc0830dd09cb760d600 Mon Sep 17 00:00:00 2001 From: Daniel Workman Date: Wed, 29 Jul 2026 15:05:58 +1000 Subject: [PATCH] Add GA4 (gtag.js) gated to the production hostname MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Completes the GA4 phase of #15. The loader is inline in the shared Layout.astro head and only injects gtag.js when location.hostname is danielworkman.dev, so localhost and preview deploys never send hits. The gate is client-side because the home page is prerendered — a server-side check would be evaluated once at build time. Closes #15 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_014gZisWihSiasHhYkx2QKac --- src/layouts/Layout.astro | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 00d4c43..00acd85 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -18,6 +18,23 @@ const { title, description = "Daniel Workman's professional portfolio and work p {title} + +