title: analytics/legacy/universallanguageselector description: >- Schema for ULS extension events. Currently this covers both various actions as well as events that log usage of certain fonts, input methods and languages. $id: /analytics/legacy/universallanguageselector/1.5.0 $schema: 'https://json-schema.org/draft-07/schema#' type: object additionalProperties: false required: - $schema - event - meta properties: $schema: description: > A URI identifying the JSONSchema for this event. This should match an schema's $id in a schema repository. E.g. /schema/title/1.0.0 type: string client_dt: description: > ISO-8601 formatted timestamp of when the event occurred/was generated in UTC). This exists separately from meta.dt in the main common schema. For external client-sent instrumentation events, we want to allow meta.dt to be the received time (filled in by EventGate at ingest time), as we don't trust client-sent events to always set the proper date and time. Client-set event generation time should be set here instead. See: https://phabricator.wikimedia.org/T240460 type: string format: date-time maxLength: 128 dt: description: 'UTC ISO-8601 timestamp of event. Deprecated, use meta.dt.' type: string format: date-time maxLength: 128 event: 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 required: - version - token - action - interfaceLanguage - contentLanguage properties: title: description: >- Page title. Used with no-search-results to analyze on which pages do people search for a page in a different language. type: string action: description: >- What the user caused or did: * ime-change: User changed the used input method. Switching input method on and off via Ctrl-M is also considered a change from/to 'system' input method. The ime id is stored in the inputMethod field. * ime-disable: User completely disabled input method functionality via ULS settings. * ime-enable: User completely enabled input method functionality via ULS settings. * language-change: User changes a language for something. The something is defined in the context field. Also the languageSelectionMethod field is filled. * font-change: User changes a font. Both contentFont and interfaceFont fields are populated. Those can be mapped to languages by inspecting the interfaceLanguage and contentLanguage fields. * no-search-result: User searched for a language with no results. The search string is stored in the context field. The page title is stored in the title field. The ulsPurpose is stored in the ulsPurpose field to understand what was the purpose of the language search: interlanguage links, IME, etc. * login-click: Anonymous user clicked login link in ULS when configured in a way that anons cannot change language. * settings-open: User opened ULS settings. The location where they were opened is stored in the context field. * ui-lang-revert: User reverted the interface language change via tooltip. * more-languages-access: Used accessed "..." to get more languages for something. The something is defined in the context field. * webfonts-enable: User enabled the webfonts functionality via ULS settings. * webfonts-disable: User completely disabled the webfonts functionality via ULS settings. * compact-language-links-open: User opens the compact language links treatment. The context field defines which trigger was used to open the treatment. type: string enum: - ime-change - ime-enable - ime-disable - language-change - font-change - no-search-results - login-click - settings-open - ui-lang-revert - more-languages-access - webfonts-enable - webfonts-disable - compact-language-links-open contentFont: description: Font name or 'system' type: string contentLanguage: description: Language code of current content language type: string context: description: >- Arbitrary action related data clarifying the context. * language-change: ** interface - user changed interface language ** content - user changed content language ** ime - user changed input language ** other - any other language selection via ULS ** languages-list - user changed content language by clicking a direct language link in the sidebar ** content-language-switcher - user changed content language after opening the compact language links treatment * no-search-results: The search string * settings-open: ** personal - uls trigger in personal tools ** interlanguage - uls cog trigger in interlanguage section of sidebar ** menu - the input tools popup menu ** preferences - from link in Special:Preferences language selection * more-languages-access: Same as for language-change * compact-language-links-open: ** other - trigger is elsewhere on the page ** header - trigger is in the header type: string inputMethod: description: Input method identifier or 'system' type: string interfaceFont: description: Font name or 'system' type: string interfaceLanguage: description: Language code of current interface language type: string isAnon: description: Is the user viewing anonymously? type: boolean languageSelectionMethod: description: |- How was the language selected. * Null if none of the below were used. * map - user clicked the map * search - user used the search field * common - user clicked from the list of common languages type: string enum: - map - search - common selectedInterfaceLanguage: description: Language code of selected interface language type: string skin: description: The skin the user is using type: string skinVersion: description: The version of the skin that the user is using. type: string timeToChangeLanguage: description: >- The time (in ms, with microsecond precision if the browser supports the Navigation Timing API) that the page was visible for before the user changed their interface language. type: number maximum: 9007199254740991 minimum: -9007199254740991 ulsPurpose: description: >- An identifier for the ULS panel. Defined as the ulsPurpose option in ULS initialization. Used with the no-search-results action to understand in what context did the person search for a language. type: string userEditBucket: description: The user's bucketized edit count type: string enum: - 1000+ edits - 100-999 edits - 5-99 edits - 1-4 edits - 0 edits version: description: >- Version number. This field can be used to track changes in instrumentation that affect the nature of the data collected. type: integer maximum: 9007199254740991 minimum: -9007199254740991 web_pageview_id: 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() type: string maxLength: 20 minLength: 20 pattern: '^[0-9a-z]{20}$' web_session_id: 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() type: string maxLength: 20 minLength: 20 pattern: '^[0-9a-z]{20}$' examples: - web_pageview_id: '55555555555555555555' web_session_id: '55555555555555555555' http: type: object properties: has_cookies: description: True if the http request has any cookies set type: boolean method: description: 'The HTTP request method (GET, POST, etc.)' type: string protocol: description: The protocol used for the request (HTTP or HTTPS) type: string request_headers: description: 'Request headers sent by the client. E.g. user-agent, etc.' type: object additionalProperties: type: string response_headers: description: Response headers sent back to the client (when known). type: object additionalProperties: type: string status_code: description: The HTTP status code returned for this request (when known) type: integer maximum: 9007199254740991 minimum: -9007199254740991 ip: description: > Client IP address that sent this event, usually best guess parsed out of from X-Client-IP header which is set by varnish from X-Forwarded-For. Deprecated, use http.client_ip. type: string meta: type: object required: - dt - stream properties: domain: description: Domain the event or entity pertains to type: string minLength: 1 dt: description: 'UTC event datetime, in ISO-8601 format' type: string format: date-time maxLength: 128 id: description: Unique ID of this event type: string request_id: description: Unique ID of the request that caused the event type: string stream: description: Name of the stream/queue/dataset that this event belongs in type: string minLength: 1 uri: description: Unique URI identifying the event or entity type: string format: uri-reference maxLength: 8192 recvFrom: description: Hostname of server emitting the log line. Deprecated. type: string revision: description: Revision ID of event schema. Deprecated. type: integer maximum: 9007199254740991 minimum: -9007199254740991 schema: description: Title of event schema. Deprecated. type: string seqId: description: Udp2log sequence ID. Deprecated. type: integer maximum: 9007199254740991 minimum: -9007199254740991 topic: description: The queue topic name this event belongs in. Deprecated. type: string uuid: description: 'Unique event identifier. Deprecated, use meta.id.' type: string maxLength: 128 webHost: description: >- Request host. 'window.location.hostname' on client-side events; $_SERVER['HTTP_HOST'] on server. type: string wiki: description: $wgDBName e.g. enwiki type: string examples: - $schema: /analytics/legacy/universallanguageselector/1.5.0 client_dt: '2020-04-02T19:11:20.942Z' dt: '2020-04-02T19:11:20.942Z' event: action: settings-open contentLanguage: en context: interlanguage interfaceLanguage: en token: aaaaaaaaaaaaaaaaaaaa version: 2 meta: dt: '2020-04-02T19:11:20.942Z' id: b0caf18d-6c7f-4403-947d-2712bbe28610 stream: eventlogging_UniversalLanguageSelector schema: UniversalLanguageSelector