From 1703120381ca1c378a89d2a5fc4c52488398879a Mon Sep 17 00:00:00 2001 From: jsshin2022 <59598545+jsshin2022@users.noreply.github.com> Date: Sun, 25 Oct 2026 12:14:21 +0000 Subject: [PATCH] Load the GA script from the hub stream's Google tag Google returns 404 for gtag/js with the hub's measurement ID, so the script never loaded and the hub has sent nothing since it moved to its own property. The stream's Google tag is the web book's tag ID; loading the script from it and configuring only the hub's ID delivers events to the hub property, confirmed in its realtime report. --- assets/js/ga.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/js/ga.js b/assets/js/ga.js index a6b941c..b296bf3 100644 --- a/assets/js/ga.js +++ b/assets/js/ga.js @@ -2,11 +2,15 @@ counted. Incoming utm_* (from shared links or other team sites) reach GA through page_location and are then removed from the address bar so the URL people copy stays clean. */ (() => { + /* ID is the hub's GA4 stream. Google serves no tag script for that ID on its own (gtag/js?id=ID is a 404); + the stream's Google tag is TAG, so the script loads from TAG and only ID is configured, which keeps the + hub's events in the hub's property. */ const ID = "G-C5V0X2SGD3"; + const TAG = "G-BEBVKYH8HL"; if (location.hostname === "causalinferencelab.github.io") { const s = document.createElement("script"); s.async = true; - s.src = `https://www.googletagmanager.com/gtag/js?id=${ID}`; + s.src = `https://www.googletagmanager.com/gtag/js?id=${TAG}`; document.head.appendChild(s); window.dataLayer = window.dataLayer || []; window.gtag = function gtag() { window.dataLayer.push(arguments); };