Skip to content

feat(analytics): first-party tracker via /_a on both docs sites (ADR-0006 Phase 2b)#12

Merged
cewert merged 1 commit into
mainfrom
adr0006/phase2b-firstparty-embed
May 31, 2026
Merged

feat(analytics): first-party tracker via /_a on both docs sites (ADR-0006 Phase 2b)#12
cewert merged 1 commit into
mainfrom
adr0006/phase2b-firstparty-embed

Conversation

@cewert

@cewert cewert commented May 31, 2026

Copy link
Copy Markdown
Member

Phase 2b of ADR-0006. Switches both docs sites' Umami embeds from cross-origin analytics.jellyrock.app/script.js to the same-origin first-party proxy (/_a/script.js), live since infra #27.

Site data-host-url
user-docs (docs.jellyrock.app) https://docs.jellyrock.app/_a
dev-docs (dev.jellyrock.app) https://dev.jellyrock.app/_a
  • Tracker POSTs to <site>/_a/api/send → Caddy strips /_a → umami /api/send.
  • No CSP risk: /_a/script.js is 'self', already allowed. Shared CSP tightens in the final infra phase.
  • analytics.jellyrock.app stays live as rollback (Bridge).

Verification

  • Both workspaces build; npm run check (astro + eslint + prettier) clean.
  • user-docs/dist and dev-docs/dist index embed /_a/script.js + data-host-url, 0 legacy origin refs.
  • Post-deploy gate: analytics-health.sh --only user-docs,dev-docs first-party/ok.

…DR-0006 Phase 2b)

Switch user-docs (docs.jellyrock.app) and dev-docs (dev.jellyrock.app) from the
cross-origin analytics.jellyrock.app tracker to the same-origin /_a proxy (live
since infra #27):

  src: '/_a/script.js'
  data-host-url: 'https://docs.jellyrock.app/_a'   (resp. https://dev.jellyrock.app/_a)

Events POST to <site>/_a/api/send, which Caddy strips to umami's /api/send.
Works under the current CSP already (/_a/script.js is 'self'); the shared CSP
tightens to script-src 'self' in the final infra phase. analytics.jellyrock.app
stays live as rollback (Bridge scope).

Verified: both workspaces build; check (astro+eslint+prettier) clean; each
dist/index.html embeds /_a/script.js with zero analytics.jellyrock.app refs.
@cewert cewert merged commit 2f4071c into main May 31, 2026
1 check passed
@cewert cewert deleted the adr0006/phase2b-firstparty-embed branch May 31, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant