==== Background
See the parent task ({T292803}) for detail about both //why// we're instrumenting #ip_info and //what// we intend to instrument.
Before we can send events via EventLogging and have them ingested by the EventGate event intake servers, however, we need to:
1. Create the JSON Schema schema used to validate the events that our instrument sends and add it to the https://gerrit.wikimedia.org/r/admin/repos/schemas/event/secondary repository
2. Update the MediaWiki extension's definition to include a stream name that we will publish our events on that will be validated by that schema
3. Profit
==== AC
[] The `analytics.mediawiki.ipinfo_interaction` (TBD) JSON Schema is defined in the https://gerrit.wikimedia.org/r/admin/repos/schemas/event/secondary repository
** By convention, it'll live in `jsonschema/analytics/mediawiki/ipinfo_interaction`
** It will have the following fields defined:
*** `event_action (string)`
**** `"open_popup"`
**** `"click_popup"`
**** `"expand"`
**** `"collapse"`
**** `"init_disclaimer"`
**** `"close_disclaimer"`
*** `event_context (string)`
**** `"page"`
**** `"accordion"`
**** `"popup"`
*** `event_source (string)`
**** `"action_history"`
**** `"special_log"`
**** `"special_recentchanges"`
*** `user_editBucket (string|null)`
*** `user_groups (string[])`
[] A basic JavaScript logger function should be defined in the IP Info codebase
[] The logger function should be enabled by a configuration variable, which is falsy by default
[] When I click the ? button next to an IP address, the following event should be logged:
```
{
"$schema": "analytics.mediawiki.ipinfo_interaction/1.0.0",
event_action: "open_popup",
event_context: "page",
event_source: "...", // Depending on the action/page that I'm on, i.e. one of "action_history", "special_log", "special_recentchanges"
user_editBucket: "...",
user_groups: [ "users", ... ]
}
```
[] When I expand the infobox, the following event should be logged:
```
{
"$schema": "analytics.mediawiki.ipinfo_interaction/1.0.0",
event_action: "expand",
event_context: "accordion",
user_editBucket: "...",
user_groups: [ "users", ... ]
}
```
[] When I collapse the infobox, the following event should be logged:
```
{
"$schema": "analytics.mediawiki.ipinfo_interaction/1.0.0",
event_action: "collapse",
event_context: "accordion",
user_editBucket: "...",
user_groups: [ "users", ... ]
}
```
==== Notes
1. We should standardise on "infobox" or "accordion" and create a task to tidy up verbiage across the codebase based on what we decide
2. `mw.config.get( 'wgUserEditCountBucket' );`, which is set by the EventLogging extension, should be used to populate `user_editBucket`
3. See https://gerrit.wikimedia.org/r/plugins/gitiles/schemas/event/secondary/+/refs/heads/master/jsonschema/analytics/mediawiki for numerous examples of JSON Schema schemas that are used in production