The way analytics frameworks typically handle A/B testing is that a flag is set in same way that we are in an A/B test for the variant A, and every piece of recorded data inherits that flag. There is no such thing in EventLogging currently, so it has to be added manually to all events which are relevant to the test, which is an unreasonable amount of work.
Proposal:
- add variant1 to the list of default EventLogging fields (wiki, useragent etc) (1 because we'll want more than one such field eventually, for multivariate tests)
- add a way of supplying a variant name to a log action EL, such as mw.eventLog.logAB( 'Foo', 'login-button:green', data ) which would set the variant1 field (NULL by default) to login-button:green.