mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
chore(ABtest): end drop experiment in favor of boosting
This commit is contained in:
@@ -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;
|
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
|
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
|
// 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)
|
* (1 + Math.max(0, 80 - (5 * user.stats.lvl)) / 100)
|
||||||
* (1 + (task.streak / 100 || 0)) // Streak bonus: +1% per streak
|
* (1 + (task.streak / 100 || 0)) // Streak bonus: +1% per streak
|
||||||
* (1 + statsComputed(user).per / 100) // PERception: +1% per point
|
* (1 + statsComputed(user).per / 100) // PERception: +1% per point
|
||||||
* (1 + (user.contributor.level / 40 || 0)) // Contrib levels: +2.5% per level
|
* (1 + (user.contributor.level / 40 || 0)) // Contrib levels: +2.5% per level
|
||||||
|
|||||||
@@ -207,7 +207,6 @@ async function registerLocal (req, res, { isV3 = false }) {
|
|||||||
.catch(err => logger.error(err));
|
.catch(err => logger.error(err));
|
||||||
|
|
||||||
if (!existingUser) {
|
if (!existingUser) {
|
||||||
savedUser._ABtests['20200625_drops'] = '12345678'.indexOf(savedUser._id.slice(0, 1)) !== -1 ? 'boosted' : 'control';
|
|
||||||
res.analytics.track('register', {
|
res.analytics.track('register', {
|
||||||
category: 'acquisition',
|
category: 'acquisition',
|
||||||
type: 'local',
|
type: 'local',
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ export async function loginSocial (req, res) { // eslint-disable-line import/pre
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!existingUser) {
|
if (!existingUser) {
|
||||||
savedUser._ABtests['20200625_drops'] = '12345678'.indexOf(savedUser._id.slice(0, 1)) !== -1 ? 'boosted' : 'control';
|
|
||||||
res.analytics.track('register', {
|
res.analytics.track('register', {
|
||||||
category: 'acquisition',
|
category: 'acquisition',
|
||||||
type: network,
|
type: network,
|
||||||
|
|||||||
@@ -201,7 +201,6 @@ function resetHabitCounters (user, tasksByType, now, daysMissed) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function trackCronAnalytics (analytics, user, _progress, options) {
|
function trackCronAnalytics (analytics, user, _progress, options) {
|
||||||
user._ABtests['20200625_drops'] = '12345678'.indexOf(user._id.slice(0, 1)) !== -1 ? 'boosted' : 'control';
|
|
||||||
analytics.track('Cron', {
|
analytics.track('Cron', {
|
||||||
category: 'behavior',
|
category: 'behavior',
|
||||||
gaLabel: 'Cron Count',
|
gaLabel: 'Cron Count',
|
||||||
|
|||||||
Reference in New Issue
Block a user