mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
fix(ABtest): record test group at registration
This commit is contained in:
@@ -207,6 +207,7 @@ 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,6 +112,7 @@ 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,
|
||||||
|
|||||||
Reference in New Issue
Block a user