From f4c840faec1b24c8f868a777edf768fa3aace785 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 30 Jul 2020 14:53:50 -0500 Subject: [PATCH] chore(ABtest): end drop experiment in favor of boosting --- website/common/script/fns/randomDrop.js | 4 ++-- website/server/libs/auth/index.js | 1 - website/server/libs/auth/social.js | 1 - website/server/libs/cron.js | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/website/common/script/fns/randomDrop.js b/website/common/script/fns/randomDrop.js index b4e418ad07..f34303ec63 100644 --- a/website/common/script/fns/randomDrop.js +++ b/website/common/script/fns/randomDrop.js @@ -46,8 +46,8 @@ export default function randomDrop (user, options, req = {}, analytics) { let chance = min([Math.abs(task.value - 21.27), 37.5]) / 150 + 0.02; chance *= task.priority // Task priority: +50% for Medium, +100% for Hard - // A/B test experiment: start users with +75% drops, diminishing by 5% per level gained - * ('12345678'.indexOf(user._id.slice(0, 1)) !== -1 ? (1 + Math.max(0, 80 - (5 * user.stats.lvl)) / 100) : 1) + // start users with +75% drops, diminishing by 5% per level gained + * (1 + Math.max(0, 80 - (5 * user.stats.lvl)) / 100) * (1 + (task.streak / 100 || 0)) // Streak bonus: +1% per streak * (1 + statsComputed(user).per / 100) // PERception: +1% per point * (1 + (user.contributor.level / 40 || 0)) // Contrib levels: +2.5% per level diff --git a/website/server/libs/auth/index.js b/website/server/libs/auth/index.js index 54e4e595f6..e8e60824f3 100644 --- a/website/server/libs/auth/index.js +++ b/website/server/libs/auth/index.js @@ -207,7 +207,6 @@ async function registerLocal (req, res, { isV3 = false }) { .catch(err => logger.error(err)); if (!existingUser) { - savedUser._ABtests['20200625_drops'] = '12345678'.indexOf(savedUser._id.slice(0, 1)) !== -1 ? 'boosted' : 'control'; res.analytics.track('register', { category: 'acquisition', type: 'local', diff --git a/website/server/libs/auth/social.js b/website/server/libs/auth/social.js index 9b3878d68c..02e4d64faf 100644 --- a/website/server/libs/auth/social.js +++ b/website/server/libs/auth/social.js @@ -112,7 +112,6 @@ export async function loginSocial (req, res) { // eslint-disable-line import/pre } if (!existingUser) { - savedUser._ABtests['20200625_drops'] = '12345678'.indexOf(savedUser._id.slice(0, 1)) !== -1 ? 'boosted' : 'control'; res.analytics.track('register', { category: 'acquisition', type: network, diff --git a/website/server/libs/cron.js b/website/server/libs/cron.js index 774309ecb5..67804c705e 100644 --- a/website/server/libs/cron.js +++ b/website/server/libs/cron.js @@ -201,7 +201,6 @@ function resetHabitCounters (user, tasksByType, now, daysMissed) { } function trackCronAnalytics (analytics, user, _progress, options) { - user._ABtests['20200625_drops'] = '12345678'.indexOf(user._id.slice(0, 1)) !== -1 ? 'boosted' : 'control'; analytics.track('Cron', { category: 'behavior', gaLabel: 'Cron Count',