mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-03 02:26:43 +09:00
- backend/tracker/sk.js: real cookieless tracker (~3.1 KB min) — pageview, external referrer, Navigation-Timing load ms, screen-class bucket, language; SPA nav via history patch + popstate; opt-in outbound/download click tracking; honors DNT; navigator.sendBeacon (text/plain, no preflight) with fetch keepalive fallback; fails silently. - scripts/build-analytics-tracker.mjs: dependency-free conservative minifier (strip comments, trim, keep newlines) → backend/tracker/sk.min.js, with a --check drift gate. Built artifact checked in (3147 bytes, under the 4 KB cap). - analytics.py: GET /sites/<id>/snippet returns the ready-to-paste <script> snippet (site_key + panel tracker URL, optional data-outlinks). - dev/test-tracker.html: manual smoke page (load tracker, fire SPA nav/outlinks). - 6 new tests (artifact bounded + comment-free, real build served, snippet + outlinks flag + 404). 59 total. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>