Extension:EventLogging/Events

Client-side events
Several extensions are logging client-side events using this extension. Most declare a schema for their events, see m:Special:PrefixIndex/Schema: for a list.

Server-side events
However, we are logging some events on the server side using the new Event logging format (by writing to the existing ClickTracking log in various hook handlers). These include


 * Article inserts (disabled?)
 * Article edits (disabled?)
 * Account creation

See for the details, look for logEvent.

Issues

 * nominate which field gets truncated if total is too long

Account creation

 * temporary details, code in development!

What to log? Other data depends on scenario
 * event_id account-create
 * version
 * obviously new user ID
 * timestamp
 * presumably new user name?
 * 1) Normal situation is anonymous user creating their own account.
 * 2) * Need the token(s) to associate anonymous actions from Account creation user experience with this (e.g. "User saw improved form" - "User clicked [Create account]" - user was successful).
 * 3) ** mw.user.id cookie
 * 4) ** clicktracking-session ?
 * 5) ** Log userbuckets token also? is it too specific?
 * 6) * TODO would like to have campaign as well for user tagging, but it's not in the query string or any cookie.
 * 7) * Language? Account Creation sometimes infers the user's language from the language selector.
 * 8) A logged-in user creates a new account (We can tell by comparing $user->getId with $wgUser->getId)
 * 9) * Do we want the info above? The cookies are presumably for the person creating the account, not the new user. (??)
 * 10) * Don't have access to the Reason field from the form (it's in the logging table in log_comment).
 * 11) * $byEmail parameter is true when (and only when?) a logged-in user creates a new account for someone else and clicks [by Email] button.

Preliminary code:


 * not sure the clicktracking-session cookie is available, may be reset on account creation

Sample log line for an anonymous user creating her account (note IDs are the same, 35):