Skip to content

chore(site): update analytics to new GTM container + GA4#61

Merged
oceans404 merged 1 commit into
mainfrom
analytics-gtm-ga4-update
Jul 16, 2026
Merged

chore(site): update analytics to new GTM container + GA4#61
oceans404 merged 1 commit into
mainfrom
analytics-gtm-ga4-update

Conversation

@oceans404

Copy link
Copy Markdown
Contributor

What

Updates the analytics tags on skills.stellar.org per Alexis (marketing).

  • Replaces GTM container GTM-KCNDDL3GTM-KPV99TKH
  • Adds GA4 (G-6PQ8C6FJSR) via @next/third-parties's GoogleAnalytics

Both load through the framework components (equivalent to the raw GTM/GA4 snippets) and stay behind the existing production-only GA_TRACKING_ENABLED gate, so nothing fires on localhost or PR previews.

Note / open question

The site now loads GTM and GA4 directly. If the GTM-KPV99TKH container is also configured to fire a GA4 tag for G-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-KCNDDL3 fully removed; only the two new IDs remain in site/
  • Not yet run locally (node_modules not installed in this checkout): please run pnpm lint:ts, pnpm lint, pnpm build before merge

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings July 15, 2026 18:33
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-16 17:46 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread site/src/app/layout.tsx
{GA_TRACKING_ENABLED && (
<>
<GoogleTagManager gtmId="GTM-KPV99TKH" />
<GoogleAnalytics gaId="G-6PQ8C6FJSR" />
@oceans404
oceans404 requested a review from jeesunikim July 15, 2026 20:22
@jeesunikim

Copy link
Copy Markdown

According to NextJS' https://nextjs.org/docs/app/guides/third-party-libraries#google-analytics:

Recommendation: If Google Tag Manager is already included in your application, you can configure Google Analytics directly using it, rather than including Google Analytics as a separate component. Refer to the documentation to learn more about the differences between Tag Manager and gtag.js.

Can we check to see if GA4 tracking is already configured in GTM? If so, this change can double count events.

@oceans404

Copy link
Copy Markdown
Contributor Author

According to NextJS' https://nextjs.org/docs/app/guides/third-party-libraries#google-analytics:

Recommendation: If Google Tag Manager is already included in your application, you can configure Google Analytics directly using it, rather than including Google Analytics as a separate component. Refer to the documentation to learn more about the differences between Tag Manager and gtag.js.

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

@oceans404
oceans404 merged commit a13a0db into main Jul 16, 2026
7 checks passed
@oceans404
oceans404 deleted the analytics-gtm-ga4-update branch July 16, 2026 17:46
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.

3 participants