Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion assets/js/ga.js
Original file line number Diff line number Diff line change
Expand Up @@ -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); };
Expand Down