feat(analytics): first-party tracker via /_a on both docs sites (ADR-0006 Phase 2b)#12
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2b of ADR-0006. Switches both docs sites' Umami embeds from cross-origin
analytics.jellyrock.app/script.jsto the same-origin first-party proxy (/_a/script.js), live since infra #27.docs.jellyrock.app)https://docs.jellyrock.app/_adev.jellyrock.app)https://dev.jellyrock.app/_a<site>/_a/api/send→ Caddy strips/_a→ umami/api/send./_a/script.jsis'self', already allowed. Shared CSP tightens in the final infra phase.analytics.jellyrock.appstays live as rollback (Bridge).Verification
npm run check(astro + eslint + prettier) clean.user-docs/distanddev-docs/distindex embed/_a/script.js+data-host-url, 0 legacy origin refs.analytics-health.sh --only user-docs,dev-docsfirst-party/ok.