title: analytics/test description: | For simple tests of analytics instrumentation $id: /analytics/test/1.0.0 $schema: 'https://json-schema.org/draft-07/schema#' type: object additionalProperties: false required: - $schema - client_dt - 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 meta: type: object required: - dt - stream properties: uri: type: string format: uri-reference maxLength: 8192 description: Unique URI identifying the event or entity request_id: description: Unique ID of the request that caused the event type: string id: description: Unique ID of this event type: string dt: type: string format: date-time maxLength: 128 description: 'UTC event datetime, in ISO-8601 format' domain: description: Domain the event or entity pertains to type: string minLength: 1 stream: description: Name of the stream/queue/dataset that this event belongs in type: string minLength: 1 http: type: object properties: method: description: 'The HTTP request method (GET, POST, etc.)' type: string status_code: description: The HTTP status code returned for this request (when known) type: integer minimum: -9007199254740991 maximum: 9007199254740991 client_ip: description: The http client's IP address type: string has_cookies: description: True if the http request has any cookies set type: boolean 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 client_dt: type: string format: date-time maxLength: 128 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 app_install_id: type: string minLength: 36 maxLength: 36 pattern: >- ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ description: > Identifies an install of the app and persists across all sessions. When the user uninstalls the app and re-installs it, a new app install ID is randomly generated. This UUIDv4 identifier is assigned automatically by the EPC library in the the Wikipedia app for Android and iOS. app_session_id: type: string minLength: 20 maxLength: 20 pattern: '^[0-9a-z]{20}$' description: > Identifies an app session: a cluster of actions taken by the user in the app within a limited period of time. A session ID is generated the first time it is requested by the instrumentation code, which will usually be soon after the user launches the app. A new session ID is generated anytime the app has been inactive (that is, in the background state) for at least 15 minutes or has been forcibly stopped by the OS or the user. This identifier is managed and assigned automatically by the EPC library in the Wikipedia app for Android and iOS. 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() test_string: type: string test_map: description: > We want to support 'map' types using additionalProperties to specify the value types. (Keys are always strings.) type: object additionalProperties: type: string examples: - $schema: /analytics/test/1.0.0 meta: stream: test.analytics.ios dt: '2020-06-11T19:20:00.649Z' client_dt: '2020-06-11T19:20:00.649Z' app_install_id: 00AB59AC-77A1-4484-B49D-A047A036C77B app_session_id: dd21852b02db926a1b81 test_string: Explore View refreshed test_map: file: Features/Feed/ExploreViewController.swift method: refreshControlActivated - $schema: /analytics/test/1.0.0 meta: stream: test.analytics.mediawiki dt: '2020-06-11T19:20:00.649Z' domain: en.wikipedia.org client_dt: '2020-06-11T19:20:00.649Z' web_session_id: 0aac0b2976c12a600a58 web_pageview_id: ba618e81066d4ea60b42 test_string: mw.config.get() test_map: skin: vector wgVersion: 1.36.0-wmf.5 wgDBname: enwiki