Repository navigation
Add PostHog for logged-out visitors outside the EEA/UK - #2602
Merged
Merged
Conversation
Restores the PostHog half of #2540, now that ui-ex #6104 and #6126 let docs.fly.io read /api/consent-scope with credentials. GA4 is left out. fly-analytics.js asks fly.io whether the visitor is logged in and whether they came through an EEA/UK edge, and loads PostHog only for logged-out visitors outside the EEA/UK. Anything else, including errors and preview hosts, loads nothing. docs.json gets a Legal footer linking the Privacy Policy. Refs superfly/docs-tracking#304 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
…_decide Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Part of superfly/docs-tracking#304. Replaces #2540, which was closed to wait for the ui-ex CORS change. That change has now shipped in superfly/ui-ex#6104 and superfly/ui-ex#6126.
This adds PostHog to docs.fly.io. GA4 from #2540 is left out. There is no consent banner on docs:
What
fly-analytics.jsdoes:https://fly.io/api/consent-scopewith credentials. ui-ex allows exactlyhttps://docs.fly.io. PostHog loads only when the answer is "not EEA/UK, logged out". Fetch failures, Mintlify previews andmint devload nothing.fly.io/static/javascripts/posthog.js. It uses the same project key andposthog.fly.iohost as fly.io.capture_pageview: "history_change"because Mintlify navigates client-side. Internal fly.io referrers are rewritten to$direct, as on landing and ui-ex.docs.jsongets a Legal footer linking the Privacy Policy.#security approved #2540, which also included GA4, so this is a subset of what was approved.
Known gap: a visitor outside the EEA/UK who rejects through fly.io's Cookie preferences link is still tracked on docs. That choice is stored per origin on fly.io. Fixing it needs a shared
.fly.ioconsent cookie.Test after merge
Previews run on
*.mintlify.site, which gets no CORS grant, so the script loads nothing there by design. On production:posthog.fly.io, and a$pageviewon each client-side navigation🤖 Generated with Claude Code