Analytics event inventory and canonical schema
Use this page to implement one event set for the whole funnel. It inventories every event, pageview and client tracking call named in this pack, maps each one to a funnel stage, lists missing events, inconsistent names and absent properties, and states one canonical schema ready to implement. This page adds no new tracking, no new field on a server record, and no new collection.
How this inventory was built
Counts come only from guides in this pack. No server code, no Worker config and no wrangler file is in this pack, so no event is claimed from code that is not in the pack. A name stated as reserved, derived, or not available is kept in that state in the tables below.
- Client events are the site.js events named in weekly quality rate and in the visitor funnel guide, plus the marketing queue in state ownership.
- Derived raw events are the report-time names in metric dictionary, built from session, question and answer records already kept, not from a client beacon.
- Test and staff preview sessions are labeled as test and excluded from every rate, and unavailable checks stay separate from not answered.
- When recording is off, no capture, storage or forwarding occurs. Opt-out is CAMPUS_ANALYTICS_OPT_OUT, Do Not Track, or Global Privacy Control.
Funnel map
Read left to right. Public stages use Monday UTC. First active workspace uses Monday college local time. The two bases are never mixed in one rate.
```mermaid
flowchart TD
A[Anonymous page view F0] --> B[CTA click F1]
B --> C[Demo request start F2]
B --> D[Sign-in start F3]
D --> E[Workspace created F4]
E --> F[First active workspace F5, question in 28 days]
F --> G[Answer shown cited]
G --> H[Rating saved]
```Complete event inventory
Each row states the event as named in the pack, its funnel stage, where it is defined, properties present, and properties absent by design or by gap.
| Event | Funnel stage | Source in this pack | Properties present | Properties absent |
|---|---|---|---|---|
| campus_page_view | F0 anonymous page view | Visitor funnel F0, weekly quality campaign audit | Clean path, utm allowlist fields, referrer class same_site external or none, source page | Workspace, assistant, channel, event id, consent flag, viewport, question text, search words. Workspace fields are null on public pages by design. |
| campus_cta_click | F1 CTA click to request demo or sign in | Visitor funnel F1, campaign audit | Destination path, utm allowlist, referrer class, source page | Workspace, assistant, channel, event id. A value already in the link is never overwritten. |
| campus_demo_request_start | F2 demo request start | Visitor funnel F2, campaign audit, request validation | Utm allowlist, referrer class, source page, and on the accepted record kind, page and attribution object validated against the same allowlist | Form field values in the attribution object, question text, email, phone, account id, token. One retry reuses the same request id and adds no second start. |
| campus_sign_in_start | F3 sign-in start, signup entry | Visitor funnel F3, campaign audit | Utm allowlist held in memory for the session, no college name and no workspace id | College name, workspace id, sign-in completed state. Completed sign-in is a session record, not this event. |
| campus_workspace_created | F4 workspace created | Visitor funnel F4, campaign audit, stated as reserved in weekly quality audit | Utm allowlist fields, workspace record tenant_id and created timestamp used to join to F5 | College name and question text in the event by design. No workspace id in the event by design. |
| campus_feedback_given | Viewed answer, rating saved | Weekly quality event spec, corrected contract table | Rating helpful or not_helpful, surface, workspace, assistant, channel, week_starting_monday_utc, id in the corrected demo | Comment text, answer id, user id, question text. Changing a rating replaces the earlier rating and adds no second count. |
| campus_answer_shown | Asked question to viewed answer | Weekly quality event spec, corrected contract table | Outcome not_answered only for this rate, surface, workspace, assistant, channel, week_starting_monday_utc, id in the corrected demo | Handed off and unavailable in this event by design, question text, answer text, user id. Handed off stays in the handoff rate and unavailable stays separate. |
| campus_guide_search_performed | Search before answer | Weekly quality event spec, corrected contract table | Surface guides terminology or workspace, result_bucket no_result or with_result, workspace, assistant, channel, week_starting_monday_utc, id in the corrected demo | Search words, result count beyond the bucket, public server record. Public search server record is stated as not available in this pack. |
| campus-quality custom event | Demo only, weekly quality tool on its page | Weekly quality instrument section | Same payload as the three quality events above, dispatched on the page for a future collector, kept on device only capped at 100 | Production collector, signed-in workspace fields are null on the demo. Do not emit this name in the signed-in app. |
| Install start and install completed | Anonymous, mentioned in audit only | Weekly quality audit sentence only, no names or schema stated in this pack | Name of the allowed class only | Exact event names, fields, and funnel stage. Do not emit until names and fields are stated in the same release. |
| Derived raw events, not client beacons | Signed-in workspace to asked to viewed, derived at report time | Metric dictionary raw event catalogue, owner dashboard metrics | sign_in_completed from session, question_submitted, answer_shown_cited, rating_saved, question_handed_off, search_performed server record where present, each with tenant_id, is_test, created_at and the fields named in that catalogue | Client beacon for these names, visitor identity, fingerprint, address, marketing identifier. Do not add a beacon for a derived event. |
Inconsistent names found in this pack
Keep the canonical name in the right column only. The left column is never emitted after this guide ships.
| Inconsistent name | Where it appears | Canonical name |
|---|---|---|
| campus_answer_feedback, campus_answer_unanswered, campus_search_no_result | Retired names listed in weekly quality event spec | campus_feedback_given, campus_answer_shown, campus_guide_search_performed. Retired names must not be emitted. |
| value for all three quality events | Weekly quality mismatch list for the demo before correction | rating for feedback, outcome for answer shown, result_bucket for search performed. |
| week, ts, surface weekly-quality-rate-guide | Weekly quality mismatch list for the demo before correction | week_starting_monday_utc, no ts field, surface guides on the demo and guides terminology or workspace in the signed-in app. |
| week, nothelpful, noresult, withresult in getWeekly | Weekly quality mismatch list for the aggregate API | week_starting_monday_utc, helpful, not_helpful, unanswered, no_result_searches, with_result_searches. |
| Derived names without campus prefix, such as question_submitted | Metric dictionary raw event catalogue | Keep derived names for report-time derivation only. Client events keep the campus prefix. Do not rename a derived event into a beacon or a beacon into a derived event. |
| page and pageSize, sort week with order asc or desc | Weekly table legacy mapping in pagination and filtering, weekly quality demo table | limit, offset, sort week_asc or week_desc on the weekly table, and limit default 50 maximum 200 on signed-in lists. Echo limit and offset, never page and pageSize. |
| Marketing queue persisted in localStorage on the weekly demo versus in-memory queue in site.js | State ownership marketing queue row, weekly quality instrument section | Production marketing queue is in-memory only capped at 100 with no network, cookie or storage. Weekly demo persistence under campus-answers weekly-quality v1 is demo only and is not the production queue. |
Missing events and absent properties
Each row states a gap, not a new fact. A missing event is not invented in this guide.
| Gap | Funnel stage | Rule until it ships |
|---|---|---|
| No client event for question submitted on the public widget | Asked question on a public route | Derive from the question record only after a record is created. Do not use a pageview or a CTA click as a question numerator. |
| No client event for handoff started or handoff reply viewed | Asked to viewed, handoff path | Use question_handed_off derived from the question record and thread record. No per-event send is added. |
| No distinct answer viewed event, only answer shown | Viewed answer | Use campus_answer_shown once per shown answer. Do not add a view duration event or a second count for a reopen. |
| No client event for workspace activated, F5 is derived | Signed-in workspace to first active workspace | Derive F5 from tenant_id and question created_at in 28 days. Do not emit a beacon for activation. |
| No client event for source link click | Viewed answer to source check | Do not add a source click event in this release. The source check stays a manual step in Ask and check sources. |
| No event for rating change, only rating saved | Viewed answer | Changing a rating replaces the earlier rating for the same answer and adds no second count, as the event spec states. |
| Campaign fields absent from the three quality events | All stages | Quality events carry no utm fields. Funnel events carry the utm allowlist only. Do not join quality to campaign by a new field in this release. |
| Week basis absent from every payload | All stages | Public stages state Monday UTC on screen. Signed-in stages state Monday college local time on screen. The payload carries week_starting_monday_utc only, and the signed-in app converts before counting. |
| Consent and opt-out flag absent from every payload | All stages | Opt-out suppresses recording before any event is built. No consent flag is recorded and no outcome is recorded when opt-out is on. |
Canonical schema ready to implement
Implement exactly these fields. No extra field is added and no listed field is omitted. An unknown event name fails closed and records nothing.
| Field | Type and rule |
|---|---|
| event | String, one of campus_page_view, campus_cta_click, campus_demo_request_start, campus_sign_in_start, campus_workspace_created, campus_feedback_given, campus_answer_shown, campus_guide_search_performed. No other name is emitted. |
| id | String, generated once per event, passed back unchanged, used only to ignore a retry of the same dispatch. |
| surface | String, guides, terminology or workspace for quality events, and the page surface for funnel events. Null only where the pack states null on the public demo. |
| workspace, assistant, channel | String or null. Null on public pages with no signed-in workspace. Filled from the record at report time in the signed-in app, never omitted and never typed by the client. |
| week_starting_monday_utc | String, YYYY-MM-DD, a Monday in UTC at 00:00. The signed-in app converts to college local time before counting and states the basis on screen. |
| Event | Extra fields only |
|---|---|
| campus_page_view, campus_cta_click, campus_demo_request_start, campus_sign_in_start, campus_workspace_created | Clean path or destination path, utm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_id each trimmed to 120 characters with letters digits dot underscore or hyphen only, referrer class same_site external or none, source page clean path. No other query parameter is read. |
| campus_feedback_given | rating, helpful or not_helpful only. No comment text. |
| campus_answer_shown | outcome, not_answered only for the weekly quality rate. No question text. |
| campus_guide_search_performed | result_bucket, no_result or with_result only. No search words and no result count beyond the bucket. |
- Never in any event: question text, answer text, comment text, search words, source title, source link, passage, office contact detail, person name, email, phone, account id, student record detail, file content, file name, token, tenant_id, user_id, or full referrer address.
- Validate every event name and every enum value before recording. A retired name, a missing field, or an extra field fails closed and records nothing.
- Cap the in-memory marketing queue at 100 in site.js. The weekly demo cap of 100 on device is a demo cap only.
- Store first-touch campaign values only in session storage under campus-answers campaign v1, only when recording is not off. Values in a later page address win over stored values.
- Forward campaign values only to same-origin links to request demo and sign in. External links are never changed. A value already in the link is never overwritten.
Implementation in order
Ship in this order through the normal build, with no manual step. Each step keeps every existing test passing before the next step starts.
Step 1: Lock the allowlist
Set the eight client event names above as the only emitted names in site.js and in the weekly quality demo. Remove every retired name and every legacy aggregate name from emitted payloads.
Step 2: Emit the common envelope
Add event, id, surface, workspace, assistant, channel and week_starting_monday_utc to every client event, with workspace, assistant and channel as null on public pages.
Step 3: Add per-event fields only
Add rating, outcome or result_bucket only on the three quality events, and the utm allowlist with referrer class and source page only on the five funnel events.
Step 4: Suppress before recording
Check CAMPUS_ANALYTICS_OPT_OUT, Do Not Track and Global Privacy Control before building any event. When any is in a true form, record nothing, store nothing and forward nothing.
Step 5: Derive the rest at report time
Derive sign_in_completed, question_submitted, answer_shown_cited, rating_saved, question_handed_off and workspace activation from session, question, answer and workspace records already kept. Add no beacon for a derived event.
Step 6: Add tests for the schema
Test each event name, each enum value, each absent field, opt-out suppression, test session exclusion, and one retry with the same id ignored as a duplicate.
Checks before you ship a schema change
Run each check in a test college workspace with test recipients. If a check fails, fix it before a live send.
- Emit each of the eight client events once and confirm the payload holds only the common envelope plus the per-event fields for that event, with no extra field and no missing field
- Emit a retired name, a legacy aggregate name, and an unknown event and confirm each records nothing and the weekly table is unchanged
- Turn on each opt-out signal in turn and confirm no event is recorded, no campaign value is stored, and no link is forwarded
- Submit a demo request twice with the same request id and confirm one start is counted, and change a rating and confirm one count for the same answer
- Run the same query in two colleges and confirm no record from the other college appears in any count and system view shows counts by workspace only
- Confirm a week with a zero denominator shows no measured outcomes in this range, not zero percent, with counts beside the rate
Follow Weekly quality rate for the three quality events, Visitor funnel for F0 to F5, Metric dictionary for derived events and the nine core KPIs, and Read reports for counts by college and assistant.
Next guide
Use one definition for every number, then open the list behind it.