Metrics Platform/Sampling Units

From Wikitech

This page provides details about the properties, defined in the Metrics Platform Event Schema, which may be used as sampling units.

Pageview ID

Every pageview is an independent event with a unique ID. A new pageview ID is generated when the user:

  • Navigates to a page;
  • Refreshes the page;
  • Opens the page again in the same window or tab; or
  • Opens the page again in a different window or tab
FIXME: The pageview ID should be regenerated when navigating away from and then back to the page quickly.

Actions which occur within the scope of a single pageview can be correlated by pageview ID. Actions which occur within the scope of multiple pageviews cannot be correlated by pageview ID. These actions must have taken place on a single device and it is safe to assume they were performed by a single user. However, a pageview ID cannot be used as a proxy for an individual user.

Session ID

A browsing session consists of one or more pageviews on one domain. A new session ID is generated when the user:

  • First navigates to a page;
  • Opens the page again in a private browsing window or tab; or
  • When the session expires

Actions which occur within the scope of a session – i.e. within the scope of multiple pageviews – can be correlated by session ID. These actions must have taken place on a single device and it safe to assume they were performed by a single user. A session ID can be used as a proxy for an individual user.

Session Expiry

Sessions can expire on the Wikipedias and in the iOS and Android apps. When a session expires a new session ID is generated. Now, the mechanism for session expiry on the Wikipedias is different for that in the apps:

  • On MediaWiki, a session expires if the user has not clicked, typed, or scrolled in the foreground window or tab for at least 30 minutes;
  • In the apps, a session expires if the user has not used the app for at least 30 minutes

Session Scope

On MediaWiki, the session ID is per-domain. If a user views a page on domain A, clicks an interwiki link, and views a page on domain B, then they have two session IDs. Currently, we cannot link those two session IDs.

Additional info about sessions can be found at Analytics/Sessions.

App Install ID

An app install consists of one or more sessions. A new app install ID is generated when the user first opts into tracking, and opts out of tracking and then opts back into tracking.

Actions which occur within the scope of an app install – i.e. within the scope of multiple sessions – can be correlated by app install ID. These actions must have taken place on a single device and it safe to assume they were performed by a single user. An app install ID can be used as a proxy for an individual user. However, because an app install ID can be regenerated, it cannot be used as a proxy for an individual device.