Files
canina/specs/catalog-analytics/verification.md
T

19 lines
3.7 KiB
Markdown

# Local verification and release boundary
## Outcome
Catalog mode remains untouched. Online sales are intentionally closed pending importer approval; historical absence of ecommerce rows is not evidence of broken tracking or no demand. No add/remove cart, checkout, purchase, subscription, money/currency conversion or backend changes made. This supersedes the initial commerce implementation request.
First-party events: explicit `page_view`, `catalog_product_view`, `catalog_content_view`, `internal_navigation`, `contact_intent`. Route classes only: no raw slugs, titles, search terms, query/hash, customer identity or contact destination. Views measure committed routes, not server-confirmed product availability or paid conversions. Article-to-product clicks carry source/target route classes, not content-level attribution. Contact intent only follows an actual anchor click (tel/mailto/internal contact page), not an inferred lead, submitted form or active subscription. Modified/cancelled/non-primary clicks excluded. Direct GA owns these events when configured; otherwise GTM dataLayer. Existing deferred initialization preserved. Returning to initial pathname emits again; same-path query/hash changes intentionally do not. DNT and GPC prevent initialization and first-party emissions; existing configured enablement remains controlled by layout/SEO settings. No consent CMP/storage policy was found or introduced.
## TDD and checks
- RED: targeted run before implementation: route single-owner assertion failed (old duplicate GTM pageview) and helper suite failed unresolved new module; 12 existing tests passed. Tests existed before implementation.
- GREEN: targeted analytics plus ProductPage/CheckoutPage catalog guard regressions: 4 files, 38 tests passed.
- Full storefront suite: 99 files, 509 tests passed, exit 0. Log `/opt/data/cache/scratch/catalog-analytics-full-tests.log` (local non-versioned evidence).
- `npm run typecheck`: exit 0.
- Targeted ESLint: exit 0; 9 pre-existing-style `any` warnings in vendor shim, no Hook dependency warnings.
- `npm run build`: exit 0; all 29 static pages generated. Build reports unavailable local backend reads at 127.0.0.1:4001/4400 and workspace-lockfile warning. Therefore not proof of integrated API content or Stage acceptance.
- Tests only inspect DOM/shim payloads in jsdom, no new third-party network requests. Existing catalog restrictions verified in ProductPage/CheckoutPage tests; availability code not edited.
## Not yet proven / Stage prerequisites
No push, deployment, runtime configuration, analytics provisioning, live writes or vendor event delivery performed. Release must pin the explicit commit containing these files, never build a moving shared HEAD. Browser/network + DebugView receipts and later GA4 report ingestion needed before calling telemetry live. GTM container and GA4 enhanced-measurement history settings were not inspected; third-party duplicate tags/automatic history events and vendor-collected URL/referrer defaults need a separate configuration/privacy audit. This patch's single-owner guarantee is only for first-party emitted events, not arbitrary GTM tags. Deferred short visits/clicks before initialization remain undercounted. Route-template minimization intentionally prevents per-article/product identification; approved public content IDs and registration of bounded custom dimensions are a follow-up contract if needed. Organic acquisition and engagement remain GA4/GSC reporting, not synthesized events. Clarity project installation exists but export token still needs secure user provisioning; no token changes in this scope. Commerce stays out of scope until business authorization and verified paid-order/money contracts exist.