From ea2f436a27bdd1fbd71112469edc7b540e4cee1e Mon Sep 17 00:00:00 2001 From: teetangh Date: Wed, 15 Apr 2026 14:52:38 +0530 Subject: [PATCH] feat(docs): add Google Analytics (GTM + GA4) to Docusaurus site 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. --- website/docusaurus.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 79fa4230..33730f96 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -47,6 +47,13 @@ const config = { theme: { customCss: "./src/css/custom.css", }, + googleTagManager: { + containerId: "GTM-MVPNN2", + }, + gtag: { + trackingID: "G-CVKKEY0D6B", + anonymizeIP: true, + }, }), ], ],