title: fragment/analytics/web_identifiers description: > Standard identifiers for Wikimedia product/feature analytics on MediaWiki-powered mobile and desktop websites. NOTE: Unlike the fields in the related app_identifiers fragment -- which are filled in automatically by the Event Platform Client libraries for Android and iOS -- these fields are (currently) *not* automatically set by EventLogging's `mw.eventLog.submit()` and must be set by instrumentation code when it is putting together the event data. $id: /fragment/analytics/web_identifiers/1.0.0 $schema: https://json-schema.org/draft-07/schema# type: object properties: web_session_id: type: string minLength: 20 maxLength: 20 pattern: ^[0-9a-z]{20}$ description: > Identifies a web session: a cluster of actions taken by the user on a website within a limited period of time. A session ID is generated the first time it is requested by the instrumentation code, which is usually the first time the user visits the website. In the current implementation, this ID is shared across windows, tabs, and page views in the same browser. The ID is normally regenerated after the browser is shut down; however, if the browser's "restore previous session" feature is used when it restarts, the previous ID is retained. Interactions across multiple pages in the same web session may be linked together via this identifier. Instrumentation code should assign this with mw.user.sessionId() web_pageview_id: type: string minLength: 20 maxLength: 20 pattern: ^[0-9a-z]{20}$ description: > Identifies a single web page view (visit). This identifier is randomly generated the first time it is requested by the instrumentation code on any page view and persists for the lifetime of the page. When the user navigates to another page or refreshes/reloads the page, this identifier disappears and a new one is regenerated (when needed). Different visits to the same page will yield different pageview IDs (also called tokens). Interactions with multiple features (instrumented separately) on the same web page may be linked together via this identifier. Instrumentation code should assign this with mw.user.getPageviewToken()