Background
Currently when looking at mediawiki_web_ab_test_enrollment in isolation it's not possible to see if the event is for logged in users or anonymous users. It must be joined with another schema to work out that information. Since some schemas have different sampling rates for anonymous and logged in users, it might be helpful to understand when events are missing why that might be.
Having this field in the schema would make the analysis of the A/B test more straightforward
Acceptance criteria
- Add field in mediawiki_web_ab_test_enrollment that tracks whether user is anon
- Add field in mediawiki_web_ab_test_enrollment that tracks whether user is bot
QA steps
- To test with local event logging, make sure an A/B test is enabled i.e. TOC experiment config is set in local settings:
$wgVectorWebABTestEnrollment = [ 'name' => 'skin-vector-toc-experiment', 'enabled' => true, 'buckets' => [ 'unsampled' => [ 'samplingRate' => 0, ], 'control' => [ 'samplingRate' => 0.5, ], 'treatment' => [ 'samplingRate' => 0.5, ] ] ];
- Navigate to an article page as anonymous, then logged-in user
- Note in local event stream that the new properties is_anon + is_bot are populated and correspond to your logged state
- I don't have a good way of testing is_bot other than injecting code into the following function locally and reloading page:
function isUserBot() { mw.config.set( 'wgUserGroups', [ '*', 'bot' ] ); var userGroups = mw.config.get( 'wgUserGroups', [] ); return userGroups.indexOf( 'bot' ) !== -1; }
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T307381#7981675 |
2 | ✅ | T307381#7981675 |