PHP logging
EventLogging::logEvent( 'WikipediaPortal', 23086389, $event );
extension.json setup for JavaScript logging
{
"attributes":{
"EventLogging":{
"Schemas":{
"WikipediaPortal":23086389
}
}
}
}
JavaScript logging
mw.track('event.WikipediaPortal',{/* ... */});
From Meta, a Wikimedia project coordination wiki
description | "Logs basic information about the use of the Wikipedia
portal (www.wikipedia.org). Most of the things we want (user agent, say) are already tracked. It is important to note that the sessions can last an arbitrary length of time as session ID is set to expire 15 minutes after the initial landing, with the expiration timer resetting every time the user comes back to the page within the 15 minute timer. This means that we can (and do) have sessions that last for hours with thousands of events logged to them." |
---|
properties | session_id | type | "string" |
---|
required | true |
---|
description | "A unique session ID that identifies events from a single user, resetting on every portal view. In other words, both 'landing' and 'clickthrough' events from a single user in a single session can be clumped together." |
---|
|
---|
event_type | type | "string" |
---|
required | true |
---|
enum | "landing"
"clickthrough"
"select-language" |
---|
description | "The type of event we're logging. Options are 'landing' - the start event, when someone shows up on a portal; 'clickthrough', indicating that they chose a link or the search bar or whatever and went somewhere else; and 'select-language', which means the user has selected a different language to search in" |
---|
|
---|
section_used | type | "string" |
---|
required | false |
---|
enum | "primary links"
"search"
"language search"
"secondary links"
"other languages"
"other projects" |
---|
description | "The overall section interacted with. This could be
'primary links' (the called-out project links around the globe',
'search' (the main search box), 'language search' (' Find Wikipedia in a language'),
'secondary links' (the less-prominent plaintext links)
'other languages' (this page in other langauges)
or 'other projects' (links to wikisource, wiktionary, et al, portals).
NULL in the case that 'event_type' is landing" |
---|
|
---|
destination | type | "string" |
---|
required | false |
---|
description | "Where the user clicked through to.
This may be NULL if the event type is 'landing'" |
---|
|
---|
referer | type | "string" |
---|
required | false |
---|
description | "The referer the user came from, if known. May be NULL." |
---|
|
---|
country | type | "string" |
---|
required | false |
---|
description | "The ISO code for the country the user geolocates to. May be NULL." |
---|
|
---|
accept_language | type | "string" |
---|
required | true |
---|
description | "The accept_language header from the user's request" |
---|
|
---|
cohort | type | "string" |
---|
required | false |
---|
description | "A cohort identifier. We can use this for running A/B tests or unrelated experiments, with the population who are *not* in any tests getting a NULL cohort field, meaning we can base our dashboards off those users and A/B test from the same schema in peace." |
---|
|
---|
selected_language | type | "string" |
---|
required | false |
---|
description | "The language that the user has selected to search in. In most cases, we expect this to be the same as the first language in 'accept_language' since that is selected automatically. When the user searches ('event_type' is 'clickthrough' and 'section_used' is 'search'), this field contains the language the user searched in, in case they went to a SERP rather than a specific article." |
---|
|
---|
|
---|