mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Improve getHomePageGroup and narrow to two variants
This commit is contained in:
parent
bb38c58903
commit
435d5bb6d2
2 changed files with 33 additions and 9 deletions
|
@ -135,18 +135,13 @@ module.exports = class User extends CocoModel
|
|||
@announcesActionAudioGroup
|
||||
|
||||
getHomepageGroup: ->
|
||||
# return 'control'
|
||||
# return 'home-with-note'
|
||||
# return 'new-home-student'
|
||||
# return 'new-home-characters'
|
||||
return 'home-with-note' unless _.string.startsWith(me.get('preferredLanguage', true) or 'en-US', 'en')
|
||||
return @homepageGroup if @homepageGroup
|
||||
group = me.get('testGroupNumber') % 4
|
||||
@homepageGroup = switch group
|
||||
when 0 then 'control'
|
||||
when 1 then 'home-with-note'
|
||||
when 2 then 'new-home-student'
|
||||
when 3 then 'new-home-characters'
|
||||
application.tracker.identify newHomepageGroup: group unless me.isAdmin()
|
||||
when 0, 1 'home-with-note'
|
||||
when 2, 3 then 'new-home-student'
|
||||
application.tracker.identify newHomepageGroup: @homepageGroup unless me.isAdmin()
|
||||
return @homepageGroup
|
||||
|
||||
# Signs and Portents was receiving updates after test started, and also had a big bug on March 4, so just look at test from March 5 on.
|
||||
|
|
29
scripts/analytics/mongodb/queries/abHomepageGroup.js
Normal file
29
scripts/analytics/mongodb/queries/abHomepageGroup.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
// abHomePageGroup A/B Results
|
||||
// Test started 2016-02-03
|
||||
// Main conversion actions (viewing quote requests, playing levels) tracked in Mixpanel
|
||||
// This just looks at who has a trial request, and then also who created an account, based on homePageGroup
|
||||
|
||||
// Usage:
|
||||
// mongo <address>:<port>/<database> <script file> -u <username> -p <password>
|
||||
|
||||
var groups = {
|
||||
'0': {name: 'control', count: 0, registeredCount: 0},
|
||||
'1': {name: 'home-with-note', count: 0, registeredCount: 0},
|
||||
'2': {name: 'new-home-student', count: 0, registeredCount: 0},
|
||||
'3': {name: 'new-home-characters', count: 0, registeredCount: 0}
|
||||
};
|
||||
|
||||
var requests = db.trial.requests.find({created: {$gt: new Date(2016, 1, 3)}}).toArray();
|
||||
var userIDs = requests.map(function(r) { return r.applicant; });
|
||||
var applicants = db.users.find({_id: {$in: userIDs}}).toArray();
|
||||
var counts = {};
|
||||
function format(u) {
|
||||
var group = groups[u.testGroupNumber % 4];
|
||||
++group.count;
|
||||
if (u.email)
|
||||
++group.registeredCount;
|
||||
return [u.email || u.name || u._id + '', group.name].join('\t');
|
||||
}
|
||||
print(applicants.map(format).join('\n'));
|
||||
print(applicants.length, "trial requests across groups:");
|
||||
print(JSON.stringify(groups, null, 2));
|
Loading…
Reference in a new issue