Skip to content

Add Google Analytics#134

Merged
teetangh merged 1 commit into
mainfrom
feat/google-analytics
Apr 15, 2026
Merged

Add Google Analytics#134
teetangh merged 1 commit into
mainfrom
feat/google-analytics

Conversation

@teetangh
Copy link
Copy Markdown
Contributor

@teetangh teetangh commented Apr 15, 2026

Summary

Adds Google Analytics tracking to the Docusaurus documentation site, mirroring the pattern from Couchbase-Ecosystem/cbl-ionic-docs#51.

  • Adds googleTagManager (container GTM-MVPNN2) and gtag (tracking ID G-J3B5K0YX8B, anonymizeIP: true) inside the preset-classic options in website/docusaurus.config.js.
  • Uses the official Docusaurus plugins, which handle SPA client-side navigations out of the box.

Test plan

  • npm run build completes cleanly, no plugin warnings
  • Initial page load: gtm.js?id=GTM-MVPNN2 and gtag/js?id=G-J3B5K0YX8B loaders fire
  • Initial page load: GA4 beacon google-analytics.com/g/collect fires with tid=G-J3B5K0YX8B, en=page_view, ep.anonymize_ip=true
  • SPA navigation (clicking a sidebar link): a new page_view beacon fires with the updated dl/dp — verified via Chrome DevTools network inspection
  • No console errors
  • Google Ads tag AW-1019232421 (configured in the corporate GTM container) also fires, confirming the GTM wiring is live

Copilot AI review requested due to automatic review settings April 15, 2026 09:23
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-15 12:26 UTC

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds Google Tag Manager and Google Analytics (gtag) configurations to the Docusaurus site. Feedback suggests avoiding the simultaneous use of both GTM and gtag to prevent double-counting and improve performance, recommending instead that GA4 be managed within GTM. Additionally, the anonymizeIP parameter is noted as redundant for GA4 properties.

Comment thread website/docusaurus.config.js
Comment thread website/docusaurus.config.js Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Google Analytics tracking to the Docusaurus documentation site by enabling Docusaurus’ built-in Google Tag Manager and Google Global Site Tag integrations.

Changes:

  • Configure googleTagManager with container GTM-MVPNN2 in the preset-classic options.
  • Configure gtag with GA4 measurement ID G-J3B5K0YX8B and anonymizeIP: true.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@teetangh teetangh marked this pull request as draft April 15, 2026 09:25
@teetangh teetangh self-assigned this Apr 15, 2026
@teetangh teetangh force-pushed the feat/google-analytics branch from 7122aca to 9f71841 Compare April 15, 2026 09:40
Mirrors the pattern from Couchbase-Ecosystem/cbl-ionic-docs#51:
adds googleTagManager (GTM-MVPNN2) and gtag (G-J3B5K0YX8B) plugins
inside preset-classic options. The Docusaurus plugins handle SPA
navigations correctly out of the box.

Verified locally via Chrome DevTools: gtm.js + gtag/js load on initial
page, GA4 page_view beacon fires on initial load, and a new page_view
beacon fires on client-side navigation with the updated path.
@teetangh teetangh force-pushed the feat/google-analytics branch from 9f71841 to ea2f436 Compare April 15, 2026 11:11
@teetangh teetangh marked this pull request as ready for review April 15, 2026 12:20
@teetangh teetangh merged commit 4777370 into main Apr 15, 2026
15 checks passed
@nithishr nithishr deleted the feat/google-analytics branch April 20, 2026 17:15
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