Add GA4 measurement with legal-audit deployment gate - #5
Merged
Conversation
TueJon
marked this pull request as draft
July 24, 2026 17:54
Findings and full rationale in docs/LEGAL_COMPLIANCE_PLAN.md (audit 2026-07-24): - Add privacy.html (bilingual, Art. 13 GDPR: server logs, localStorage, self-hosted fonts, data-subject rights, DSB complaint contact) and link it from every page footer plus the imprint - Self-host Familjen Grotesk and Spline Sans Mono (SIL OFL) from /fonts/; drop the fonts.googleapis.com / fonts.gstatic.com embeds on all pages - Persist wmcp-lang only on an explicit language choice (toggle click or WebMCP set_language call), not on automatic first-load detection - Imprint: label the address row as seat & address (§14 UGB) - Accessibility: announceable copy toast, localized toggle aria-label and diagram title in German mode, og/twitter image alt texts - llms.txt: 'byte-identical' -> 'behaves identically' (accuracy)
Merges fix/legal-compliance (privacy policy, self-hosted fonts) and closes
the legal-audit launch gate from docs/LEGAL_COMPLIANCE_PLAN.md P2.1:
- consent.js is now the only script entry: nothing GA-related runs before
opt-in — no gtag.js request, no dataLayer command, no cookie (basic
Consent Mode). analytics.js no longer has import side effects.
- Banner with Allow/Decline as identical .btn buttons on one layer,
non-modal so imprint and privacy policy stay reachable; footer 'Cookie
settings' button reopens it. Declining after a grant sets ga-disable,
pushes a consent-denied update, and expires _ga*/_gcl* cookies.
- Decision stored as wmcp-consent {v, analytics, ts} — timestamped, no
identifier.
- page_location sent to GA is origin + path + attribution params only;
arbitrary query data and fragments stay local. cookie_domain pinned,
Secure;SameSite=Lax, consent defaults pushed as the first command,
dataLayer entries use the canonical arguments form.
- privacy.html: GA4 section (both languages) covering recipients, DPF
transfer basis, cookies incl. _gcl_au, retention semantics, withdrawal.
- ANALYTICS.md rewritten for the consent architecture; retention and
automatic-collection wording corrected; account-level data-sharing
check flagged before first production traffic.
- 18 contract tests (node --test), incl. no-side-effect-on-import and
full consent lifecycle.
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.
TUE-377 measurement deliverable; companion proof PR: TueJon/webmcpify#4
This draft now implements the selected GA4 setup and supersedes the original first-party logger proposal.
What changed:
G-45GCGY7SQN;External account setup already completed:
546963195is linked only to Ads client835-125-6521;install_command_copyis the Primary campaign conversion andgithub_outboundis Secondary;Merge and deployment gate
If deployed as currently written, the Google tag loads on page startup and may set Analytics cookies before consent. This PR is therefore intentionally DRAFT and must not be merged or deployed until the separate legal/privacy audit is complete.
Before approval:
ANALYTICS.mdand this PR.Verification completed:
node --test tests/analytics.test.mjs— 7/7 passingnode --check analytics.jspython3 build-de.pygit diff --checkNothing in this PR has been deployed, and no ad spend has been enabled.