chore(site): update analytics to new GTM container + GA4#61
Conversation
Replace GTM container GTM-KCNDDL3 with GTM-KPV99TKH and add GA4 (G-6PQ8C6FJSR) via @next/third-parties. Both stay behind the existing production-only GA_TRACKING_ENABLED gate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
There was a problem hiding this comment.
Pull request overview
Updates site analytics by replacing the GTM container and adding direct GA4 tracking behind the existing production-only gate.
Changes:
- Replaces the existing GTM container ID.
- Adds GA4 through
GoogleAnalytics.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {GA_TRACKING_ENABLED && ( | ||
| <> | ||
| <GoogleTagManager gtmId="GTM-KPV99TKH" /> | ||
| <GoogleAnalytics gaId="G-6PQ8C6FJSR" /> |
|
According to NextJS' https://nextjs.org/docs/app/guides/third-party-libraries#google-analytics:
Can we check to see if GA4 tracking is already configured in GTM? If so, this change can double count events. |
Alexis from marketing asked us to keep it this way for now - docs is configured this way too and I think they dedupe on their side. I'll follow up with her about both docs and skills tracking |
What
Updates the analytics tags on skills.stellar.org per Alexis (marketing).
GTM-KCNDDL3→GTM-KPV99TKHG-6PQ8C6FJSR) via@next/third-parties'sGoogleAnalyticsBoth load through the framework components (equivalent to the raw GTM/GA4 snippets) and stay behind the existing production-only
GA_TRACKING_ENABLEDgate, so nothing fires on localhost or PR previews.Note / open question
The site now loads GTM and GA4 directly. If the
GTM-KPV99TKHcontainer is also configured to fire a GA4 tag forG-6PQ8C6FJSR, pageviews will be double-counted. Confirming intended setup with marketing; may follow up with a tweak to fire GA4 from only one source.Testing
GTM-KCNDDL3fully removed; only the two new IDs remain insite/node_modulesnot installed in this checkout): please runpnpm lint:ts,pnpm lint,pnpm buildbefore merge🤖 Generated with Claude Code