PHP logging

EventLogging::logEvent( 'AutocompleteSatisfaction', 15333917, $event );

extension.json setup for JavaScript logging

{
	"attributes": {
		"EventLogging": {
			"Schemas": {
				"AutocompleteSatisfaction": 15333917
			}
		}
	}
}

JavaScript logging

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

Schema:AutocompleteSatisfaction

From Meta, a Wikimedia project coordination wiki
Revision 15333917
Jump to navigation Jump to search
description"Tracks the dwell time and bounce rate of a user's session on pages linked from a search engine result page. The first use of this schema will be to log editors' search sessions to compare clickthrough and dwell time between those with the Completion Suggester beta feature on vs. those have not opted in."
properties
searchSessionId
type"string"
requiredtrue
description"A unique identifier generated per search session. A search session identifies a single user performing searches within a limited timespan. If no search is performed within ten minutes of a previous search a new session id is generated."
mwSessionId
type"string"
requiredtrue
description"MediaWiki session id for correlating together actions in other schemas, such as QuickSurveys"
pageViewId
type"string"
requiredtrue
description"A unique identifier generated per visited page. This allows a visitPage and checkin events to be directly correlated."
action
type"string"
requiredtrue
enum
"searchResultPage"
"visitPage"
"checkin"
description"Identifies the context in which the event was created. Every time a new search is performed a searchEngineResultPage event is created. When the user clicks a link in the results a visitPage event is created. When the user has dwelled for N seconds (see 'checkin' below) a checkin event occurs"
query
type"string"
requiredfalse
description"The actual terms the user searched for. This is only logged with searchResultPage actions"
hitsReturned
type"integer"
requiredfalse
description"The number of results returned and shown in the SERP. This is only logged with searchResultPage actions"
position
type"integer"
requiredfalse
description"The position of the search result in the search result set, including any offsets."
checkin
type"integer"
requiredfalse
description"A numeric value representing the number of seconds a user has spent on a page. As with Schema:TestSearchSatisfaction2, the pings are at 10s, 20s, ..., 50s, 60s, 90s, 120s (2min), 150s, 180s (3min), 210s, 240s (4min), 300s (5min), 360s (6min), 420s (7min)."
scroll
type"boolean"
requiredtrue
description"Indicates if the user has scrolled the page since the last event with the same pageId"
abTest
type"string"
requiredfalse
description"The name of any A/B-test that this user is participating in."
extraParams
type"string"
requiredfalse
description"Allows for additional parameters: • 'completion-suggest-on' if user has opted-in to the Completion Suggester beta feature • NULL otherwise"