Skip to content

fix(analytics): initialize GA directly in page HTML - #34

Merged
gbzarelli merged 1 commit into
mainfrom
gz/ga-init-before-external
Oct 25, 2026
Merged

gbzarelli merged 1 commit into
mainfrom
gz/ga-init-before-external

Conversation

@gbzarelli

Copy link
Copy Markdown
Member

Summary

  • Initialize the GA4 dataLayer directly in the rendered HTML before the asynchronous Google tag.
  • Keep the current GA4 measurement ID and Google-managed pageview detection.

Validation

  • npm run lint
  • npm run build
  • Confirmed the static export contains inline initialization and the async Google tag without relying on Next's beforeInteractive queue.
  • Confirmed the current deployed page had no runtime gtag/dataLayer in browser, which this change addresses.

@gbzarelli
gbzarelli merged commit 82e240c into main Oct 25, 2026
1 check passed
@gbzarelli
gbzarelli deleted the gz/ga-init-before-external branch October 25, 2026 18:05

This branch was previously deployed

1 inactive deployment
deploy — c00a7481 Deployed Oct 25, 2026 by gbzarelli via build #80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant