Skip to content

Commit ea2f436

Browse files
committed
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.
1 parent b197b4c commit ea2f436

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

website/docusaurus.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ const config = {
4747
theme: {
4848
customCss: "./src/css/custom.css",
4949
},
50+
googleTagManager: {
51+
containerId: "GTM-MVPNN2",
52+
},
53+
gtag: {
54+
trackingID: "G-CVKKEY0D6B",
55+
anonymizeIP: true,
56+
},
5057
}),
5158
],
5259
],

0 commit comments

Comments
 (0)