feat(analytics): route GA4 through GTM and instrument engagement events - #2300
Open
GigaHierz wants to merge 2 commits into
Open
feat(analytics): route GA4 through GTM and instrument engagement events#2300GigaHierz wants to merge 2 commits into
GigaHierz wants to merge 2 commits into
Conversation
Swap the bare ga4 integration in docs.json for GTM (tagId placeholder until the container is created), fire dataLayer events from AddNetworkButton for the add-network conversion, and document the measurement setup in ANALYTICS.md: GTM/GA4 runbooks for humans and a Cloudflare AI Crawl Control runbook for bot/agent traffic, which no client-side tag can see. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Upgrades docs.celo.org measurement beyond bare page views. One concern: analytics instrumentation.
docs.json: swapintegrations.ga4forintegrations.gtm. The GA4 Google Tag (same property,G-0CXEKQ81V2, so reporting history stays continuous) moves inside the GTM container; keeping both would double-count page views. ContainerGTM-NP9GP2BTis created and published with the GA4 Google Tag.snippets/AddNetworkButton.jsx: pushdataLayerevents for the add-network conversion —add_network_clickandadd_network_result(success/rejected/error/no_wallet). Highest-intent action on the site, previously untracked.ANALYTICS.md(new, internal — not innavigation, so not a public page): architecture and three runbooks — GTM container tags/triggers, GA4 property config (AI-assistant channel group, custom dimensions, exit-page explorations), and Cloudflare AI Crawl Control for bot/agent traffic, which no client-side tag can see (AI crawlers don't execute JS).AGENTS.md: one-line pointer to ANALYTICS.md.Why
The site had a single GA4 measurement ID and nothing else: no referrer/drop-off/engagement instrumentation and zero visibility into AI-agent traffic, which reads
llms.txtand.mdvariants directly. GTM (free) is the only sanctioned route to custom event tracking on Mintlify hosting without a plan upgrade; Cloudflare (free) is the only layer that can count non-JS bots.Before merge
GTM-XXXXXXXindocs.jsonVerification
mint broken-linkson the branch head:snippets/AddNetworkButton.jsxsyntax-checked with esbuild (compiles clean). No pages moved; no redirects needed.🤖 Generated with Claude Code