diff --git a/src/events/components/events.ts b/src/events/components/events.ts index 87ab0ee5fe..2b09056c07 100644 --- a/src/events/components/events.ts +++ b/src/events/components/events.ts @@ -94,6 +94,7 @@ type SendEventProps = { [EventType.link]: { link_url: string link_samesite?: boolean + link_samepage?: boolean link_container?: string } [EventType.page]: {} @@ -377,6 +378,7 @@ function initLinkEvent() { type: EventType.link, link_url: link.href, link_samesite: sameSite, + link_samepage: sameSite && link.pathname === location.pathname, link_container: container?.dataset.container, }) }) @@ -389,6 +391,9 @@ function initLinkEvent() { sendEvent({ type: EventType.link, link_url: `${url}#scroll-to-top`, + link_samesite: true, + link_samepage: true, + link_container: 'static', }) }) } diff --git a/src/events/lib/schema.js b/src/events/lib/schema.js index b94b805269..297cd539f0 100644 --- a/src/events/lib/schema.js +++ b/src/events/lib/schema.js @@ -253,6 +253,10 @@ const link = { type: 'boolean', description: 'If the link stays on docs.github.com.', }, + link_samepage: { + type: 'boolean', + description: 'If the link stays on the same page (hash link).', + }, link_container: { type: 'string', enum: [ @@ -265,6 +269,7 @@ const link = { 'article', 'toc', 'footer', + 'static', ], description: 'The part of the page where the user clicked the link.', }, diff --git a/src/frame/middleware/healthz.js b/src/frame/middleware/healthz.ts similarity index 100% rename from src/frame/middleware/healthz.js rename to src/frame/middleware/healthz.ts diff --git a/src/frame/middleware/index.ts b/src/frame/middleware/index.ts index 8c6e05ecba..e95cbab023 100644 --- a/src/frame/middleware/index.ts +++ b/src/frame/middleware/index.ts @@ -27,7 +27,7 @@ import findPage from './find-page.js' import blockRobots from './block-robots.js' import archivedEnterpriseVersionsAssets from '@/archives/middleware/archived-enterprise-versions-assets.js' import api from './api.js' -import healthz from './healthz.js' +import healthz from './healthz' import productIcons from './product-icons.js' import manifestJson from './manifest-json.js' import remoteIP from './remote-ip.js'