You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GitHub Pages via GitHub Actions (`.github/workflows/deploy.yml`). Every push to `main` builds and publishes `dist/`.
97
+
98
+
## Analytics
99
+
Google Tag Manager is injected into `BaseLayout.astro` when `PUBLIC_GTM_ID` is set at build time. GA4 is configured inside the GTM container (not in code), so tag changes never require a redeploy.
100
+
101
+
- Local: set `PUBLIC_GTM_ID=GTM-XXXXXXX` in `devdrift/.env` (gitignored).
102
+
- CI: set a repository **Variable**`PUBLIC_GTM_ID` in GitHub → Settings → Secrets and variables → Actions → Variables. The deploy workflow passes it to the build step via `env:`.
103
+
- When unset, the snippet is omitted entirely (graceful no-op for local dev).
0 commit comments