PHP logging

EventLogging::logEvent( 'ReadingDepth', 18559669, $event );

extension.json setup for JavaScript logging

{
	"attributes": {
		"EventLogging": {
			"Schemas": {
				"ReadingDepth": 18559669
			}
		}
	}
}

JavaScript logging

mw.track( 'event.ReadingDepth', { /* ... */ } );

Schema:ReadingDepth

From Meta, a Wikimedia project coordination wiki
Revision 18559669
Jump to navigation Jump to search
description"Measures reading depth. Events only logged for UAs that support the Beacon API <http://caniuse.com/#feat=beacon> and the Page Visibility API <https://caniuse.com/#feat=pagevisibility>."
properties
pageTitle
type"string"
description"The title of the page."
requiredtrue
namespaceId
type"integer"
requiredtrue
description"Namespace ID of the page."
pageID
type"integer"
description"The ID of the page (https://www.mediawiki.org/wiki/Manual:Page_table#page_id , not available for Special: pages, i.e. namespace -1)."
requiredfalse
revisionID
type"integer"
description"The revision of the page that is being viewed (https://www.mediawiki.org/wiki/Manual:Revision_table#rev_id , not available for Special: pages, i.e. namespace -1)."
requiredfalse
isAnon
type"boolean"
description"Is the user viewing anonymously?"
requiredtrue
skin
type"string"
description"Skin being used by reader"
requiredtrue
totalLength
requiredfalse
type"integer"
description"Total length of time (in milliseconds) from the firstPaint (if available) or DOMinteractive (if first paint unavailable) event to the page being unloaded."
domInteractiveTime
requiredtrue
type"integer"
description"Total length of time (in milliseconds) till DOM interactive event."
firstPaintTime
requiredfalse
type"integer"
description"Total length of time (in milliseconds) till first paint (null if not available)."
visibleLength
requiredfalse
type"integer"
description"Total length of time (in milliseconds) that the page content was visible to the user as defined by the Page Visibility API."
action
type"string"
enum
"pageLoaded"
"pageUnloaded"
description"`pageLoaded` happens once per page view, near the beginning. `pageUnloaded` is sent upon leaving the page (if caught)."
requiredtrue
pageToken
type"string"
description"One-time token per page load (consistent with Schema:PageIssues and other schemas that use https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.user-method-getPageviewToken )."
requiredtrue
sessionToken
type"string"
description"Session token that survives across pages (mw.user.sessionId()), but not browser restarts, used in deterministic user bucketing"
requiredtrue
default_sample
type"boolean"
description"Default sample group. Set when schema has been initiated by the ReadingDepth test."
requiredfalse
page-issues-a_sample
type"boolean"
description"Sample group set when the schema has been initiated by the PageIssues test for users in bucket A."
requiredfalse
page-issues-b_sample
type"boolean"
description"Sample group set when the schema has been initiated by the PageIssues test for users in bucket B."
requiredfalse