Skip to content

[AAASM-3558] 🔧 (docs): Pre-check analytics consent (Accept enables analytics)#171

Merged
Chisanan232 merged 1 commit into
masterfrom
v0.0.1/AAASM-3558/accept_grants_analytics
Jun 23, 2026
Merged

[AAASM-3558] 🔧 (docs): Pre-check analytics consent (Accept enables analytics)#171
Chisanan232 merged 1 commit into
masterfrom
v0.0.1/AAASM-3558/accept_grants_analytics

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

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.yml had extra.consent.cookies.analytics.checked: false. Material also auto-adds a github consent 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 to analytics_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

  • 🔧 Bug fix

Breaking Changes

  • No

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:

  • Manual testing performed
State feedback form stored __consent notes
Initial load (undecided) hidden null window.gtag is a function; 1 cookieless /g/collect hit fires
Click Accept visible (👍/👎 present) {github:true, analytics:true} Consent Mode analytics_storage: granted; clicking 👍 sends exactly 1 feedback event
Click Reject (fresh context) hidden {} analytics not granted
  • No unit/integration tests required (config-only, docs-site change; verified via headless-browser consent-UI driving)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated if needed
  • All tests passing

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>
@Chisanan232

Copy link
Copy Markdown
Contributor Author

Claude Code — review result

CI green — all 4 checks pass (Analyze python, CodeQL, Build documentation); mkdocs build --strict clean. MERGEABLE. No fails to ignore.

Scope vs AAASM-3558 (residual fix) — covered. One-line change: extra.consent.cookies.analytics.checked: false → true. This closes the live-QA gap where clicking the consent "Accept" button stored only {github:true} (analytics defaults unchecked + an auto-added github cookie), leaving analytics denied and the feedback widget hidden after Accept. With analytics pre-checked, "Accept" now grants it.

Verified live (Chromium, real consent UI, deep page):

  • Undecided → feedback hidden, gtag function, 1 cookieless /g/collect hit.
  • Accept → stored consent {github:true, analytics:true}, Consent Mode analytics_storage: granted, feedback visible, 👍 → exactly 1 feedback event.
  • Reject → consent {}, feedback hidden.

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 mkdocs.yml touched; the #170 override partials are untouched.

Ready for approval + merge. (Post-merge: re-verify on the live published site that Accept reveals the buttons.)

@Chisanan232 Chisanan232 merged commit 91d64c0 into master Jun 23, 2026
6 checks passed
@Chisanan232 Chisanan232 deleted the v0.0.1/AAASM-3558/accept_grants_analytics branch June 23, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant