PHP logging

EventLogging::logEvent( 'MobileWebSectionUsage', 15412308, $event );

extension.json setup for JavaScript logging

{
	"attributes": {
		"EventLogging": {
			"Schemas": {
				"MobileWebSectionUsage": 15412308
			}
		}
	}
}

JavaScript logging

mw.eventLog.logEvent( 'MobileWebSectionUsage', { /* ... */ } );

Schema:MobileWebSectionUsage

From Meta, a Wikimedia project coordination wiki
Revision 15412308
Jump to: navigation, search
description"Logs reading actions relating to sections for a 1% sample of users"
properties
pageId
requiredtrue
type"integer"
description"ID of the page user is reading."
namespace
requiredtrue
type"integer"
description"Namespace ID of the page the user is reading, to allow us to measure behaviour across namespaces."
sectionCount
requiredtrue
type"integer"
description"Number of top level headings on the current page, to allow us to filter out pages which have no collapsible sections and thus cannot fire a open-section event. A section with no headings has a section count of zero (lead section is not included as a section)."
hasServiceWorkerSupport
requiredtrue
type"boolean"
description"Whether the user's device could potentially support ServiceWorker."
isTestA
type"boolean"
description"Whether the user is bucketed into a test group A, which sees all sections in expanded state on initial page load. The control group, where this value is FALSE, sees the standard view with all sections initially collapsed."
isTablet
requiredtrue
type"boolean"
description"Whether the user is running the mobile site in tablet mode or higher (e.g. screen > 768px)"
sessionId
requiredtrue
type"string"
description"Identifies a specific user/device, based on MediaWiki's mw.user.sessionId() which is tied to browser sessions. Allows us to link events across a single page and other pages they visit for a given device. (See also T119146)"
eventName
type"string"
requiredtrue
enum
"entered"
"scrolled-into-view"
"open-section"
"close-section"
description"The action that has occurred, either entering the schema (when the page is loaded), a section's heading scrolling into the viewport for the first time, opening a section, or closing a section."
section
type"integer"
description"The number of the section that is opened, closed, or scrolled into view (not present on 'entered' events)"