== Background
Based on {T287709} and subsequent discussion, we will be creating a schema that tracks whether the user is in the control or test bucket of the sticky header A/B test.
== Acceptance criteria
[x] Setup the A/B test schema.
[x] Add a configuration option to Vector for controlling whether the sticky header is shown.
[x] When the Vector experiment is enabled, make use of `mediawiki.experiments` to determine the bucket (`mw.experiments.getBucket`) and notify WikimediaEvents that an experiment is running (consider calling `mw.track('wikimediaEvents.experiments')`).
[x] The WikimediaEvents extension when notified that an experiment is running should log an event which contains:
-- [x] the user session ID
-- [x] the experiment group the user is assigned to (A or B). This should come from the value of `mw.experiments.getBucket`
-- [x] the experiment name (which is communicated to it by Vector)
-- [] the user ID.
[x] If no experiment is running the WikimediaEvents should log nothing to the new schema
== Developer notes
The mediawiki experiments module in core, provides a lot of the infrastructure needed here.
```
mw.experiments.getBucket( {
name: 'My first experiment',
enabled: true,
buckets: {
control: 0.5
A: 0.25,
B: 0.25
}
} )
```
Notes on schema came from the events defined in the [[ https://docs.google.com/spreadsheets/d/1xIYNfXMGghVdnCNTjz7ujLm0BHCv6kfMqc9SRGm_MOU/edit#gid=1871341179 | sticky header instrumentation spec ]]
== QA steps
- For testing event logging locally, the following config will be needed in local settings:
```
$wgVectorWebABTestEnrollment = [
'name' => 'sticky_header_2021_11',
'enabled' => true,
'buckets' => [
'control' => [
'samplingRate' => 0.33,
],
'stickyHeaderDisabled' => [
'samplingRate' => 0.33,
],
'stickyHeaderEnabled' => [
'samplingRate' => 0.34,
]
]
];
```
- Create some new test users to make sure you have one in each group: `control`, `stickyHeaderDisabled`, `stickyHeaderEnabled` (eventlogging will indicate which bucket the user is in by the group key).
- For all groups, an init event will be logged on page load (no other time) like the following:
{F34722721}