Record canonical special page names in virtual pageviews

When analyzing event data special pages are a bit unique. They
are the same across all wikis, but the name is typically
localized to the wiki itself. The localization is relatively
constant, but can change in ways that the canonical special page
names do not. Simplify analyzing virtualpageviews from special
pages by recording the canonical name of the page, rather than
the localized name.

Changes the VirtualPageViews event submission to provide
wgCanonicalSpecialPageName when appropriate.

Bug: T375387
Change-Id: Ia344d8d60058082fdf0715281d732e5c1f90a38a
This commit is contained in:
Erik Bernhardson 2024-09-30 12:15:29 -07:00
parent d6b589f50b
commit a3af7c91b5
3 changed files with 3 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View file

@ -26,7 +26,9 @@ export default function pageviews(
/* eslint-disable camelcase */ /* eslint-disable camelcase */
source_page_id: page.id, source_page_id: page.id,
source_namespace: page.namespaceId, source_namespace: page.namespaceId,
source_title: mw.Title.newFromText( page.title ).getPrefixedDb(), source_title: page.namespaceId === -1 ?
mw.config.get( 'wgCanonicalSpecialPageName' ) :
mw.Title.newFromText( page.title ).getPrefixedDb(),
source_url: page.url, source_url: page.url,
page_id: pageview.page_id, page_id: pageview.page_id,
page_namespace: pageview.page_namespace, page_namespace: pageview.page_namespace,