Analytics privacy and consent schema for public pages
Use this schema on every public page. No signed-in user identifier, no workspace content and no personal data are captured on a public page. Public analytics record counts and buckets only, after a consent check, and a signed-in app derives workspace fields at report time from records already kept.
Audit findings in pack app-campus.site.2
Each row names the file and code path in the pack, the data at risk, and the corrected rule. No finding adds a new event name and no finding adds a tracker.
| Finding | Where it is in the pack | Gap | Corrected rule |
|---|---|---|---|
| Gap 1. Search words written to the address before the consent check | public/guides/weekly-quality-rate.html, search check handler, writeSearchToHash and readSearchFromHash using fragment q | The raw search query is written to the fragment before record() checks Do Not Track, Global Privacy Control or CAMPUS_ANALYTICS_OPT_OUT. The fragment persists in browser history, can be copied in a shared link, and restores the query into the field. This contradicts the statement on the same page that no search words are recorded. | Never write a search query to the address, fragment, history, storage or any log. Keep only the result bucket, no_result or with_result, in history state. Check consent before any search handling. When consent is off, clear the field handling, record nothing and write nothing. |
| Gap 2. Campaign allowlist includes a search term field | public/guides/weekly-quality-rate.html, campaign attribution section, ALLOWED list and allowlist bullet | utm_term holds external search words by definition. Keeping it in the allowlist captures search words on a public page and forwards them to /request-demo and /app/, contradicting the rule that search words are never captured. | Remove utm_term from the allowlist. Allow only utm_source, utm_medium, utm_campaign, utm_content and utm_id. Treat utm_term and any other dropped parameter as name only, with the value never shown, stored or forwarded. |
| Gap 3. Stored campaign values are read and kept when consent is off | public/guides/weekly-quality-rate.html, campaign tool, readStored, effectiveValues and render, session storage key campus-answers:campaign:v1 | Stored values are read before the opt-out branch sets values to empty, and the store is never cleared when Do Not Track, Global Privacy Control or CAMPUS_ANALYTICS_OPT_OUT is on. A later page can forward stored values after the reader has opted out. | Run the consent gate first. When consent is off, do not read the store, remove the store key, do not forward links and do not build a payload. When consent is on, read page address values first and stored values only when the address has none. |
| Checked and kept. Public quality events carry no signed-in identifier | public/guides/weekly-quality-rate.html, record function, CampusQuality aggregate and CSV | No gap found in the payload as shipped. Payload fields are id, event, surface guides, workspace null, assistant null, channel null, week_starting_monday_utc and one bucket field. Events are capped at 100 in memory, dispatched as campus-quality for a future collector, and the CSV holds counts and rates only. | Keep this shape. The per-event id is random per event and is not derived from an account, device or workspace. It must never be replaced with a persistent identifier. |
| Checked and kept. Site analytics event list in the pack | public/guides/search-indexing.html and public/guides/weekly-quality-rate.html, references to public/site.js | No gap found in the stated list. The pack states that site.js allows only page view, call to action, sign-in start, demo request start, install start, install completed and a reserved workspace event, with no feedback event and no search word read or sent. | Keep the list closed. Any new field must pass the schema below and the consent gate. Do not add a client beacon for quality events in the signed-in app. Derive quality events from records at report time. |
Local device tools on other guides, such as My Answers storage, the share copy tool and the role checklist, keep data on the device only and send no server request. They are outside analytics. They must not be copied into an analytics payload.
Corrected privacy-safe event schema
Use these fields only. A strict collector drops any field not listed here. Public pages send workspace, assistant and channel as null. The signed-in app fills those three fields from the record at report time, never from a client identifier.
| Event | Allowed fields beyond the common fields | Common fields on every event | Never in any event |
|---|---|---|---|
| campus_feedback_given | rating with value helpful or not_helpful. No comment text. | event, surface with value guides on a public page, workspace null, assistant null, channel null, week_starting_monday_utc, one random per-event id | Account id, email, name, question text, answer text, comment text, source title, source link, workspace content, office contact detail, file name or content, token, full referrer address, search words |
| campus_answer_shown | outcome with value not_answered only for the weekly quality rate. No question text. | Same common fields as above | Same list as above, plus no saved claim for an unavailable check |
| campus_guide_search_performed | surface with value guides, terminology or workspace, and result_bucket with value no_result or with_result. No search words and no result count beyond the bucket. | Same common fields as above | Same list as above, plus no query string, no fragment, and no history entry that holds the query |
| campus_page_view, campus_cta_click, campus_sign_in_start, campus_demo_request_start, campus_workspace_created | Allowlisted campaign fields utm_source, utm_medium, utm_campaign, utm_content and utm_id, referrer class same_site, external or none, and source_page as a clean path. No college name and no workspace id in campus_workspace_created. | Same consent gate and no persistent identifier | Same list as above, plus utm_term, full referrer address, search words, form field values and any other query parameter value |
- Retired names campus_answer_feedback, campus_answer_unanswered and campus_search_no_result must not be emitted.
- Test and staff preview sessions are labeled as test and excluded from every rate, with the excluded count shown where the screen can count it.
- System view returns counts grouped by workspace only. No event payload, identifier or role detail is returned in system view.
- Reading event detail needs the same separate permission as reading full question text and is audit logged. Exports carry filters and row count and include counts only by default.
Consent gate, in order
Run this gate at the start of every public analytics path, before any read, write, forward, dispatch or download. A path that cannot run the gate must not record.
Step 1: Check opt-out
When window.CAMPUS_ANALYTICS_OPT_OUT is true, or navigator.globalPrivacyControl is true, or Do Not Track is 1 or yes, stop. Clear the campaign store key, do not read storage, do not write the address, do not forward links and do not dispatch an event. Show recording off wording in the status region.
Step 2: Read only the allowlist
Read only utm_source, utm_medium, utm_campaign, utm_content and utm_id from the page address. Trim each value, drop any value longer than 120 characters or with characters outside letters, digits, dot, underscore or hyphen, and drop utm_term and every other parameter by name only.
Step 3: Store first touch in session only
Store the first allowlisted set in session storage under campus-answers:campaign:v1 only when consent is on. Do not overwrite a stored set with an empty set. Values in a later page address win over stored values.
Step 4: Forward to two destinations only
Append allowlisted values to same-origin links to /request-demo and /app/ only. Never overwrite a value already in the link query. Keep a fragment. Never change an external link.
Step 5: Record buckets only
Record the rating, outcome or result bucket for the current week only. Never record the query, the question text, the answer text, workspace content or a signed-in identifier. Keep events in memory, cap at 100, and use a random per-event id for retry deduplication.
Step 6: Validate on the server again
The demo request endpoint and the signed-in app validate the same allowlist again, drop unknown fields, and exclude test and staff preview sessions with a label. No form field value goes in an attribution object.
Checks before you ship an analytics change
Run each check on a public page with consent on and with consent off. If a check fails, fix it before you publish.
- With Do Not Track, Global Privacy Control or CAMPUS_ANALYTICS_OPT_OUT on, a search records nothing, writes nothing to the address or storage, and shows recording off wording
- With consent on, a search that has no match records only result bucket no_result, a search with a match records only with_result, and no search word appears in the address, history, storage, event payload or CSV
- A page address with utm_term and an unknown parameter shows names only for dropped parameters, and neither value appears in a payload, a forwarded link or a stored value
- With consent off, the campaign store key is removed, no stored value is read, and Request a demo and Sign in links carry no campaign value
- Every public event payload shows workspace null, assistant null and channel null, and no payload holds an account id, workspace content, question text, answer text, source title, source link, office contact detail, form value, full referrer address or token
- The weekly table and CSV show counts and rates only, with week_starting_monday_utc, and a zero denominator shows no measured outcomes in this range
- Retired event names do not appear in code, payloads or exports, and no new event name has been added
Next guide
Read the weekly rate with its counts, then work the largest gap first.