Drop Cap A/B Tests: v2 (#12759)

* drop cap ab test: enroll all web users, 50/50

* update tests

* fix lint
This commit is contained in:
Matteo Pagliazzi
2020-11-03 21:19:09 +01:00
committed by GitHub
parent b17c9a33a5
commit 14714f9e1c
3 changed files with 8 additions and 31 deletions

View File

@@ -534,13 +534,11 @@ schema.methods.enrollInDropCapABTest = function enrollInDropCapABTest (xClientHe
if (isWeb && !this._ABtests.dropCapNotif && !this.isSubscribed()) {
const testGroup = Math.random();
// Enroll 20% of users, splitting them 50/50
if (testGroup <= 0.25) {
// Enroll 100% of users, splitting them 50/50
if (testGroup <= 0.50) {
this._ABtests.dropCapNotif = 'drop-cap-notif-enabled';
} else if (testGroup <= 0.5) {
this._ABtests.dropCapNotif = 'drop-cap-notif-disabled';
} else {
this._ABtests.dropCapNotif = 'drop-cap-notif-not-enrolled';
this._ABtests.dropCapNotif = 'drop-cap-notif-disabled';
}
this.markModified('_ABtests');
}