FACTORY_OUTCOME: COMPLETED

The report is at `/home/iovon/ai-factory/workspaces/lit-website-audit/ANALYTICS_501.md`. It's based on source review plus a local test with a fake browser. I didn't touch the live site, the preview or the mirror, sent no test lead, and read no GA data. No browser run or real network check was made, so the GA behavior below is from the source and the fake-browser test.

**Main findings**
- **Declined visitors still load GA.** The code loads `gtag.js` and queues a config hit before sending "denied". No consent default is ever set. This contradicts the privacy policy's "only with your explicit consent".
- **"Accept all" declines.** In the detailed cookie banner, the "Accept all" button runs the decline handler.
- **Withdrawal doesn't clear GA cookies.** Each consent change adds another `gtag.js` script tag.
- **GA may never load in the Docker deployment.** `NEXT_PUBLIC_GA_ID` is read at build time, and the repo has no `.env*` and no Dockerfile entry for it. Whether the deployed build has it is unverified.
- **Page-view and event helpers are never called.** There are no contact or CTA events and no page views on in-app navigation. The `gtag` npm package is unused.
- **Failed CRM saves look like success.** When the CRM call fails, `/api/contact` returns HTTP 202, and both forms show success. The lead then exists only in the server log.
- **Form data is logged in full.** The route logs name, email, phone, IP and free text, and echoes the form back in the response. The consent fields are logged but never saved to the CRM.
- **Policy mismatches.** The privacy policy has an unverified "26 months" retention (this must be checked in GA admin), outdated IP-anonymization wording and Facebook plug-ins that no code matches.

**Fixes prepared, not applied or deployed** (in `work/analytics501/`)
- **`analytics.patch`:** adds a denied consent default before config, loads GA only on opt-in, makes init run once, clears `_ga*` cookies on withdrawal and fixes "Accept all". Local test: decline gives 0 script tags and no commands, and accept-then-withdraw gives 1 tag and no cookies left. `git apply --check`, `tsc` and `eslint` pass.
- **`crm202.patch`:** treats HTTP 202 as an error in both forms. It changes lead-path behavior, so it needs separate approval.
- **Not patched:** log minimization, saving consent to the CRM, policy wording, build env, banner copy and abuse protection. Those need an owner or legal decision.

The report also has a browser test plan for the private preview. It uses a fake GA ID and a failure-path-only contact test. It ends with five open owner questions.

Files are in `/home/iovon/ai-factory/workspaces/lit-website-audit/`:
- `ANALYTICS_501.md`
- `work/analytics501/analytics.patch`
- `work/analytics501/crm202.patch`
- `work/analytics501/harness.ts`
- `work/analytics501/harness-output.txt`