Analytics operations

Deleting raw analytics safely without deleting the history

Raw analytics rows were growing much faster than the decisions they supported. I added an opt-in cleanup path that preserves permanent rollups first, shows a dry run, deletes in resumable batches, and guards the final checkpoint and VACUUM.

3,066-byte gzipped tracker · permanent rollups · opt-in 00:05 cleanup with dry run

01

Raw events and permanent history are different products

Pageview rows are useful for recent inspection, but indefinite raw retention is not required for every report. Daily traffic, search, bot, indexation, and first-touch landing-source history can remain useful after the underlying events age out.

The cleanup contract therefore creates and verifies permanent rollups before deleting eligible raw records.

02

Cleanup is optional and inspectable

The operator can enable a daily 00:05 cleanup, inspect a dry run from the administration interface, and keep every snapshot. Deletes run in bounded resumable batches so an interruption does not turn one maintenance job into a database recovery event.

  • Permanent daily, search, crawler, index-count, and landing-source rollups
  • Dry-run counts before destructive work
  • Resumable bounded deletion rather than one unbounded transaction
  • Guarded checkpoint and VACUUM after rollups and deletions succeed
03

Access and identity remain deliberately narrow

The stateless tracker uses no cookies or browser storage and does not write raw IP addresses, full user agents, or Client Hints. View invitations are hashed, revocable, and scoped to one property.

Visitor-days are estimates, not unique people. Edge crawler identity is user-agent-claimed unless the source IP is validated. AParser index-count checks are operator-triggered, and exact-day page and source exports currently exist through the API rather than the dashboard.

04

What the implementation proves

  • Approximately 3,066 bytes gzipped for the stateless tracker
  • Multi-property traffic, GSC, Bing, crawler, and index-count views
  • Hashed revocable property-scoped view invitations
  • Tracker tests passed 9/9; Svelte check reported zero issues; dashboard build completed

Limits: Visitor-days are not unique users. · User-agent-claimed crawler traffic is not provider-confirmed without IP validation. · AParser index counts are operator-triggered, not continuous automatic Google monitoring.