PHP logging

EventLogging::logEvent( 'Search', 15292937, $event );

extension.json setup for JavaScript logging

{
	"EventLoggingSchemas": {
		"Search": 15292937
	}
}

JavaScript logging

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

Schema:Search

From Meta, a Wikimedia project coordination wiki
Revision 15292937
Jump to: navigation, search
description"Cross-platform schema to track anonymised user actions when using the search interface, so we know how well search is meeting the needs of our users"
properties
action
description"Which particular action triggered this event -session-start - the user started a search -impression-results - search results were shown to the user as a result of explicit user input or the result set was empty -impression-didyoumean - the user was shown a 'did you mean' result recommending a different seach query that might suit their needs better -click-didyoumean - the user clicked the 'did you mean' link shown to them -impression-error - the user was presented with an error -click-result - the user finished their search by clicking on a search result -submit-form - the user finished their search by hitting enter inside the search field or clicking on the magnifying glass button -hide-search-suggestions - the user finished their search by clicking cancel or hitting back"
enum
"session-start"
"impression-results"
"impression-didyoumean"
"click-didyoumean"
"impression-error"
"click-result"
"submit-form"
"hide-search-suggestions"
type"string"
requiredtrue
resultSetType
description"Whether the search result set is prefix, fulltext, or merged. Used with action 'impression-results'."
enum
"prefix"
"fulltext"
"prefixmergedwithfulltext"
type"string"
requiredfalse
numberOfResults
description"The number of results that the user was shown as a result of their input. May be 0 if the result set is empty. Used for actions 'impression-results' and 'click-result' Note: the maximum number of results that can be displayed at once may vary from platform to platform."
type"integer"
requiredfalse
platform
description"The platform that the user is searching from."
enum
"desktop"
"mobileweb"
"iosapp"
"androidapp"
type"string"
requiredtrue
timeToDisplayResults
description"The number of milliseconds it took, from the user's point of view, between starting their query and actually being shown results. Used for actions 'impression-results' and 'impression-didyoumean'. Events should not be fired in the case that the user's query wasn't actually sent to the server (i.e., the client side code timer decided not to send search because of fast typing), although events SHOULD be sent in the case that a cached result was available client side."
type"integer"
requiredfalse
timeOffsetSinceStart
description"The number of milliseconds, from the user's point of view, since the search session began."
type"integer"
requiredtrue
clickIndex
description"The 1-based index of the search result that the user clicked on to end their search. Sent with 'click-result' actions."
type"integer"
requiredfalse
searchSessionToken
description"Session token for this Search funnel, which starts at the point a distinct search field value is sent to the server or the data in the search field will correspond to a result set available in the client side cache."
type"string"
requiredtrue
userSessionToken
description"User session token for this Search funnel. This is used to identify the full interaction with the search field."
type"string"
requiredtrue
mwUserSessionId
description"Session token from mw.user.sessionId. This is used for the sole purpose of tying this data to any data from QuickSurveys that we are running to improve search."
type"string"
requiredtrue