Skip to content

Record proxied sites' markdown, llms.txt and RSS requests under their public URL - #4660

Merged
nolannbiron merged 2 commits into
mainfrom
nolann/insights-canonical-url
Oct 7, 2026
Merged

nolannbiron merged 2 commits into
mainfrom
nolann/insights-canonical-url

Conversation

@nolannbiron

Copy link
Copy Markdown
Member

Proposed changes

For proxied sites (e.g. gitbook.com/docs), the middleware tracked server-side Insights events (markdown, llms.txt, RSS, ask) with the request URL, which is the proxy's: https://proxy.gitbook.site/sites/site_p4Xo4/changelog. The Agents report then listed Markdown reads as /sites/site_p4Xo4/changelog, while page views, sent from the browser, showed public URLs.

These events now use siteCanonicalURL, the public URL the API resolved for the request, with the request's query string. The path below the site's base is unchanged, and previews keep their request URL.

Validated locally: a markdown request through the proxy (x-gitbook-url: https://proxy.gitbook.site/sites/site_p4Xo4/changelog.md) logs Tracking 1 events at https://gitbook.com/docs/changelog.md.

Events already stored keep the proxy URL; they are not rewritten.

Changelog

  • [Fix] Markdown, llms.txt and RSS requests on proxied sites now appear in Insights under the site's public URL instead of an internal /sites/site_… path.

@changeset-bot

changeset-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f45949d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@argos-ci

argos-ci Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2-cloudflare (Inspect) 👍 Approved by Nolann Biron 9 changed, 2 ignored Oct 6, 2026, 10:56 AM
customers-v2-vercel (Inspect) 👍 Approved by Nolann Biron 6 changed, 6 ignored Oct 6, 2026, 10:56 AM
v2-cloudflare (Inspect) 👍 Approved by Nolann Biron 1 changed, 2 ignored Oct 6, 2026, 10:59 AM
v2-vercel (Inspect) ✅ No changes detected 2 ignored Oct 6, 2026, 10:56 AM

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Style invalidation on a large API reference

Elements restyled by opening one popup on the Snyk API reference. A share near or above 100% means the insertion restyles the whole document.

interaction restyled page share budget
openapi-select 5 10,817 0.0% 25% ✅
search 639 10,817 5.9% 125% ✅

@nolannbiron
nolannbiron requested a review from peterwhite October 6, 2026 11:16
@nolannbiron
nolannbiron merged commit 552538a into main Oct 7, 2026
20 checks passed
@nolannbiron
nolannbiron deleted the nolann/insights-canonical-url branch October 7, 2026 09:53

This branch was successfully deployed

2 active deployments
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.

2 participants