> For the complete documentation index, see [llms.txt](https://faction-os.gitbook.io/faction-os-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_07/session_05_analytics_consent_and_payload_controls.md).

# Session 05: Analytics Consent and Payload Controls

**Session ID**: `phase07-session05-analytics-consent-and-payload-controls` **Packages**: apps/web, packages/protocol **Status**: Not Started **Estimated Tasks**: \~14-22 **Estimated Duration**: 2-4 hours

***

## Objective

Define and implement analytics guardrails so any Umami or future analytics path is disabled by default, consent-aware, scrubbed, replaceable, and covered by payload tests before activation.

***

## Scope

### In Scope (MVP)

* Review `docs/adr/0003-umami-optional-analytics.md`, hosted-services docs, environment docs, privacy docs, and current web settings behavior.
* Define analytics provider, enabled-state, consent, opt-out, self-hosting, event taxonomy, payload minimization, and local-only fallback requirements.
* Add or refine web/protocol helpers, settings copy, unavailable states, or tests where needed to prevent accidental analytics activation or sensitive payload collection.
* Validate that analytics payloads never include prompts, file contents, command bodies, terminal output, transcripts, tokens, broad paths, exports, replay buffers, scan payloads, media drafts, diagnostics, logs, backups, or quarantined historical content.
* Keep analytics disabled unless both configuration and user or operator consent requirements are satisfied.
* Update hosted-services, privacy, environments, release, UX PRD, and package README docs.

### Out of Scope

* Shipping a production analytics dashboard, hosted analytics account setup, marketing funnel, user tracking beyond the approved taxonomy, or server-side analytics ingestion.
* Making analytics required for local development, public demo use, or War Room collaboration.
* Claiming GDPR completion beyond the evidence actually validated.

***

## Prerequisites

* [ ] Sessions 01-04 are complete or analytics ownership is explicitly unblocked by the routing matrix.
* [ ] Current web settings and browser storage behavior are reviewed.
* [ ] Analytics-sensitive payload blocklists are available from Session 01.

***

## Deliverables

1. Analytics consent and payload control spec.
2. Disabled-default analytics provider and consent behavior where source changes are made.
3. Payload tests or validation notes for approved analytics event taxonomy.
4. Updated hosted-service, privacy, environment, release, UX, and package README docs.

***

## Success Criteria

* [ ] Analytics is disabled by default and has explicit enablement and consent boundaries.
* [ ] Approved analytics events are documented, minimal, scrubbed, and testable.
* [ ] Sensitive local developer data cannot enter analytics payloads through the scoped implementation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_07/session_05_analytics_consent_and_payload_controls.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
