PHP logging

EventLogging::logEvent( 'TestSearchSatisfaction', 12423691, $event );

extension.json setup for JavaScript logging

{
	"attributes": {
		"EventLogging": {
			"Schemas": {
				"TestSearchSatisfaction": 12423691
			}
		}
	}
}

JavaScript logging

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

Schema:TestSearchSatisfaction

From Meta, a Wikimedia project coordination wiki
Revision 12423691
Jump to navigation Jump to search
description"Tracks the dwell time and bounce rate of a user on pages linked from a search engine result page."
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."
depth
type"integer"
requiredtrue
description"Records how many clicks away from the search page the user currently is. The SERP is 0, direct search results are 1 and it keeps increasing from there."
pageId
type"string"
requiredtrue
description"A unique identifier generated per visited page. This allows a visitPage event to be correlated with a leavePage event."
logId
type"string"
requiredtrue
description"A unique identifier generated per event. The SendBeaconReliability test showed that we have to expect duplicated events to be sent from the browser, so this allows de-duplicating those events."
action
type"string"
requiredtrue
enum
"searchEngineResultPage"
"visitPage"
"leavePage"
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 leaves that page a leavePage event is created. Following links within the content area of a page that fired visitPage/leavePage events will also cause visitPage/leavePage events to be fired on the subsequent pages."