Repository navigation
feat: add regional Google Analytics for public docs - #254
Merged
Merged
Conversation
| ${initSidebarLevels.toString()} | ||
| ${mountHomeHero.toString()} | ||
| ${createHomeGlimm.toString()} | ||
| const docsAnalytics=(${createDocsAnalytics.toString()})(()=>import(withBase(${JSON.stringify("/assets/" + webVitalsAssetName)}))); |
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 Problem This Solves
Adds the approved Google Analytics measurement and regional choices for public documentation on
docs.openclaw.ai.User Impact
Public pageviews, native enhanced events, content/search engagement, copy outcomes and eligible document performance become measurable. A persistent Google Analytics choice controls collection. Private assistant activity remains unmeasured; feedback text never appears in an analytics-observed link. Existing server counts continue separately.
Production defaults off. The first authorized publish verifies the existing Cloudflare router's consent endpoint with the Google gate closed. Activation requires separate approval and an existing R2 shell rebuild.
Why This Change Was Made
The native Google tag owns supported enhanced events; the docs shell owns one pageview per committed initial, PJAX or restored navigation. Campaign/referral attribution and native cross-domain identity are preserved. Pagefind reports filtered public terms and actual rendered result counts, with capped lists marked partial and errors omitting counts.
Regional policy
2026-10-02.v2uses trusted Cloudflare country metadata, Basic Consent Mode, GPC/DNT overrides, a 180-day live expiry and same-origin denial propagation. Old-policy records require a fresh choice. Withdrawal prevents new denied collection or replay without reloading; already-consented batches may finish delivery. Async outcomes cannot cross private/withdrawn intervals, and document Web Vitals are omitted after eligibility is interrupted.Workflow changes add only a default-off production variable and an enabled CI artifact. Actions permissions, required checks, deployment queues and upload semantics are preserved. The event matrix and coverage limits are documented in
scripts/docs-site/ANALYTICS.md.Evidence
3428e455709555df4f94906df205a11e530a5ac5.Structured Codex Autoreview returned no actionable findings for both review groups (implementation and supporting docs/BFCache fixture); the split respects the review bundle size limit. Both patch IDs are unchanged after integration onto current main. CI has passed; coordinated closed-gate publishing approval remains required. Browser transport is not evidence of provider ingestion.