diff --git a/README.md b/README.md index 7bf5063..9ddb1c5 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,19 @@ server-side processing, authentication, confidential inputs, durable writes, or an independent compliance boundary belongs in a separate repository and hosted service, with a catalog link from this site. +## Website analytics + +The public pages load `assets/analytics-consent.js` and +`assets/analytics-consent.css`. The Google Analytics 4 tag for the QED-AI +Website property (`G-B7RCEWCGDY`) loads only after a visitor allows analytics. +The privacy notice lives at `/privacy/`, and the footer offers a persistent +Privacy choices control. New pages must include both shared assets and a +visible link to that notice. Advertising consent remains denied. The web +stream has Enhanced Measurement on, with Site Search off; its data-redaction +settings redact the glossary's `q` and `rq` URL query values. Keep the stream +settings and privacy notice aligned if the site's search or measurement +behavior changes. + ## Visual system Every public page loads `assets/styles.css`, which imports the shared cool-color diff --git a/apps/index.html b/apps/index.html index b998cf0..98d8a83 100644 --- a/apps/index.html +++ b/apps/index.html @@ -12,7 +12,9 @@ + + @@ -51,7 +53,7 @@

Open tools with visible boundaries.

diff --git a/assets/analytics-consent.css b/assets/analytics-consent.css new file mode 100644 index 0000000..9fa670e --- /dev/null +++ b/assets/analytics-consent.css @@ -0,0 +1,59 @@ +.analytics-choice[hidden] { display: none; } +.analytics-choice { + position: fixed; + z-index: 1000; + right: 1rem; + bottom: 1rem; + left: 1rem; + display: flex; + align-items: center; + justify-content: space-between; + gap: 1.5rem; + max-width: 74rem; + margin: 0 auto; + padding: 1.1rem 1.3rem; + border: 1px solid var(--line, #cbd7da); + background: var(--white, #fff); + box-shadow: 0 12px 40px #10283733; + color: var(--ink, #172936); + font: 1rem/1.5 var(--sans, Arial, sans-serif); +} +.analytics-choice-copy { max-width: 48rem; } +.analytics-choice-copy strong { display: block; margin-bottom: .2rem; } +.analytics-choice-copy p { margin: 0; font-size: .88rem; } +.analytics-choice-copy a { color: var(--accent, #176b91); text-decoration: underline; } +.analytics-choice-actions { display: flex; flex-wrap: wrap; gap: .65rem; } +.analytics-choice-actions button { + min-height: 2.75rem; + padding: .45rem .9rem; + border: 1px solid var(--surface-deep, #173546); + background: var(--white, #fff); + color: var(--surface-deep, #173546); + font: inherit; + font-size: .85rem; + font-weight: 700; + cursor: pointer; +} +.analytics-choice-actions button[data-analytics-choice="allow"] { + background: var(--surface-deep, #173546); + color: var(--white, #fff); +} +.analytics-choice button:focus-visible, +.analytics-preferences:focus-visible { outline: 3px solid var(--accent-bright, #81c7e2); outline-offset: 2px; } +footer .analytics-preferences { + padding: 0; + border: 0; + background: none; + color: inherit; + font: inherit; + font-size: .77rem; + font-weight: 700; + letter-spacing: .03em; + cursor: pointer; +} +footer .analytics-preferences:hover { color: var(--accent-bright, #81c7e2); } +footer div { flex-wrap: wrap; } +@media (max-width: 680px) { + .analytics-choice { display: block; max-height: min(75vh, 35rem); overflow-y: auto; } + .analytics-choice-actions { margin-top: .9rem; } +} diff --git a/assets/analytics-consent.js b/assets/analytics-consent.js new file mode 100644 index 0000000..e0c8454 --- /dev/null +++ b/assets/analytics-consent.js @@ -0,0 +1,120 @@ +/* Basic consent mode: the Google tag is not requested until a visitor opts in. */ +(() => { + 'use strict'; + + const measurementId = 'G-B7RCEWCGDY'; + const choiceKey = 'qed-ai-analytics-choice-v1'; + const choices = new Set(['allow', 'decline']); + let tagLoaded = false; + + function readChoice() { + try { + const value = localStorage.getItem(choiceKey); + return choices.has(value) ? value : null; + } catch { + return null; + } + } + + function saveChoice(value) { + try { + localStorage.setItem(choiceKey, value); + } catch { + // Storage can be unavailable; the choice still applies to this page. + } + } + + function clearAnalyticsCookies() { + const names = document.cookie.split(';').map(part => part.trim().split('=')[0]); + const host = location.hostname; + const domains = ['', host, `.${host}`, '.qedartifacts.org']; + for (const name of names) { + if (name !== '_ga' && !name.startsWith('_ga_')) continue; + for (const domain of domains) { + document.cookie = `${name}=; Max-Age=0; path=/; SameSite=Lax${domain ? `; domain=${domain}` : ''}`; + } + } + } + + function loadAnalytics() { + if (tagLoaded) return; + tagLoaded = true; + window.dataLayer = window.dataLayer || []; + window.gtag = function gtag() { window.dataLayer.push(arguments); }; + window.gtag('consent', 'default', { + analytics_storage: 'denied', + ad_storage: 'denied', + ad_user_data: 'denied', + ad_personalization: 'denied' + }); + window.gtag('consent', 'update', { analytics_storage: 'granted' }); + window.gtag('js', new Date()); + window.gtag('config', measurementId, { + allow_google_signals: false, + allow_ad_personalization_signals: false + }); + const tag = document.createElement('script'); + tag.async = true; + tag.src = `https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(measurementId)}`; + document.head.append(tag); + } + + const panel = document.createElement('section'); + panel.className = 'analytics-choice'; + panel.setAttribute('role', 'region'); + panel.setAttribute('aria-label', 'Analytics choice'); + panel.hidden = true; + panel.innerHTML = ` +
+ Help us understand how this site is used? +

With your permission, Google Analytics measures visits and interactions, including enhanced events such as scrolls and outbound clicks. You can decline or change your choice later. Read our privacy notice.

+
+
+ + +
`; + + function showChoice() { + panel.hidden = false; + panel.querySelector('[data-analytics-choice="decline"]').focus(); + } + + function choose(value) { + saveChoice(value); + panel.hidden = true; + if (value === 'allow') { + if (tagLoaded) { + window[`ga-disable-${measurementId}`] = false; + window.gtag('consent', 'update', { analytics_storage: 'granted' }); + window.gtag('config', measurementId); + } else { + loadAnalytics(); + } + } else if (tagLoaded) { + window[`ga-disable-${measurementId}`] = true; + window.gtag('consent', 'update', { analytics_storage: 'denied' }); + clearAnalyticsCookies(); + } + } + + panel.addEventListener('click', event => { + const choice = event.target.closest('[data-analytics-choice]')?.dataset.analyticsChoice; + if (choices.has(choice)) choose(choice); + }); + document.body.append(panel); + + document.querySelectorAll('footer div').forEach(links => { + const button = document.createElement('button'); + button.type = 'button'; + button.className = 'analytics-preferences'; + button.textContent = 'Privacy choices'; + button.addEventListener('click', showChoice); + links.append(button); + }); + document.querySelectorAll('[data-analytics-preferences]').forEach(button => { + button.addEventListener('click', showChoice); + }); + + if (readChoice() === 'allow') loadAnalytics(); + else if (!readChoice()) panel.hidden = false; +})(); diff --git a/dictionary/glossary/index.html b/dictionary/glossary/index.html index d70dbc5..350d7c0 100644 --- a/dictionary/glossary/index.html +++ b/dictionary/glossary/index.html @@ -7,7 +7,9 @@ + + @@ -11043,6 +11045,6 @@ - + diff --git a/dictionary/index.html b/dictionary/index.html index 0d7f461..cd83a71 100644 --- a/dictionary/index.html +++ b/dictionary/index.html @@ -7,6 +7,8 @@ Dictionary of Quality | QED Artifacts Institute + + @@ -26,6 +28,6 @@

Terms for clearer judgments.

Full Dictionary articles are being prepared and reviewed for later release.

- + diff --git a/index.html b/index.html index 0d05a58..cb302a4 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,8 @@ + + + + + + +
+

Website notice · December 3, 2026

+

Privacy

+
+

QED Artifacts Institute uses Google Analytics 4 on this public website only after you choose Allow analytics. If you decline, this site does not load the Google Analytics tag.

+

What we measure

+

With permission, Google Analytics records page visits and supported interactions. Enhanced Measurement is enabled for scrolls, outbound-link clicks, video engagement, file downloads, and form interactions where those features exist. The site-search event is off, and glossary search query values are redacted from URLs before Analytics receives them. Google may use cookies and similar browser identifiers for this measurement. We use the resulting reports to understand and improve the website. We do not use this tag for advertising or ad personalization.

+

Google explains how it processes information from sites that use its services. The website's hosting provider also processes ordinary connection data needed to deliver pages. Links to external services lead to those services' own privacy practices.

+

Your choice

+

Choose Allow analytics or Decline when prompted. Your choice is saved in this browser's local storage. You can change it using the Privacy choices control in the footer. If you withdraw permission, the site stops loading Analytics on subsequent pages and attempts to remove its first-party Analytics cookies in this browser. You can also clear site data in your browser.

+

+

Questions

+

Contact contact@qedartifacts.org about this notice or this website's data practices.

+
+
+ + + diff --git a/scripts/build-glossary-page.mjs b/scripts/build-glossary-page.mjs index f4bd561..4465147 100644 --- a/scripts/build-glossary-page.mjs +++ b/scripts/build-glossary-page.mjs @@ -164,7 +164,9 @@ const html = ` + + @@ -208,7 +210,7 @@ const html = `
${entryGroups}
- + `; diff --git a/sitemap.xml b/sitemap.xml index 8580dab..9c77255 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -4,4 +4,5 @@ https://qedartifacts.org/apps/2026-09-15monthly0.7 https://qedartifacts.org/dictionary/2026-10-22monthly0.7 https://qedartifacts.org/dictionary/glossary/2026-10-24weekly0.7 + https://qedartifacts.org/privacy/2026-12-03yearly0.3