[AAASM-3558] 🔧 (docs): Pre-check analytics consent (Accept enables analytics)#171
Conversation
Set extra.consent.cookies.analytics.checked: true so the consent
"Accept" button grants analytics. Previously checked:false meant Accept
stored only {github:true}; analytics stayed denied so the consent-gated
feedback widget never appeared and GA never upgraded past cookieless.
Analytics is now opt-out (pre-checked); the toggle is still shown and
Reject clears it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude Code — review result ✅ CI green — all 4 checks pass (Analyze python, CodeQL, Build documentation); Scope vs AAASM-3558 (residual fix) — covered. One-line change: Verified live (Chromium, real consent UI, deep page):
This delivers exactly the requested behavior (Accept → buttons; Reject/undecided → no buttons). Tradeoff (intended, owner-approved): analytics is now opt-out (pre-checked) rather than opt-in — the toggle is still shown so a user can uncheck before accepting, and Consent Mode keeps GA cookieless until consent is actually stored. Only Ready for approval + merge. (Post-merge: re-verify on the live published site that Accept reveals the buttons.) |
Description
Follow-up fix for AAASM-3558. PR #170 reworked the python docs to advanced Consent Mode (GA loads cookieless for everyone; the 👍/👎 feedback widget is gated to appear only when analytics consent is granted). Live QA found that clicking the consent Accept button did not grant analytics, because
mkdocs.ymlhadextra.consent.cookies.analytics.checked: false. Material also auto-adds agithubconsent cookie, so Accept stored only{github:true}— analytics stayed denied, the feedback widget never appeared after Accept, and GA never upgraded past cookieless.This PR sets
extra.consent.cookies.analytics.checked: true(one line). Now Accept grants analytics → the feedback form appears and Consent Mode updates toanalytics_storage: granted; Reject clears it → feedback hides. No changes to the analytics/feedback override partials from #170.Tradeoff: analytics consent becomes opt-out (pre-checked) rather than opt-in. The toggle is still rendered in the consent dialog, and Reject (and Manage) still clears it, so a visitor can decline.
Type of Change
Breaking Changes
Related Issues
Testing
Built the docs (
uv run mkdocs build --strict, clean) and drove the real consent UI with bundled-chromium Playwright on a deep content page (/compatibility/runtime/), seeding nothing:__consentnullwindow.gtagis a function; 1 cookieless/g/collecthit fires{github:true, analytics:true}analytics_storage: granted; clicking 👍 sends exactly 1feedbackevent{}Checklist