Incorporating custom segmenting logic

59 views
Skip to first unread message

Arvind Kalyan

unread,
Feb 26, 2016, 2:11:46 AM2/26/16
to indeedeng-proctor-users
Hi, 

I wanted to know what's the best approach to fit-in a custom segmenting logic before applying an A/B Test. It would be similar to 'Proctor Rules' which already exists. 

For eg. I have a list of users (email_ids) in DB, and I receive email_id as IDENTIFIER in the Proctor Pipet URL (/groups/identify?test=t1&id.IDENTIFIER=a...@xyz.com). Where do I do the check if this user (a...@xyz.com) already exists in the DB, and conduct A/B test only if he's in the list in DB. This would be a RULE per se, for conducting A/B tests. 

I'm think of the following approach: Have an assertion which executes custom segmenting logic before determineTestGroups() (in proctor-pipet), and if it doesn't match, don't go further. Return by allotting him default bucket (-1 value).

Is this a good approach? or does proctor have inbuilt capability to add custom rule functions of some sort that I missed?

Thanks,

Arvind.
Message has been deleted

matts

unread,
Feb 26, 2016, 11:12:48 PM2/26/16
to indeedeng-proctor-users
Hi, Arvind -


Yes, proctor has the ability to define custom functions, but I don't think that's what you want to do here.

The general pattern is to keep any potentially slow operations out of the proctor evaluation proper, choosing instead to pre-calculate context variables and to pass them into the determination. A simple global rule for the test can then use any provided context to determine whether the current visitor should be included in the test or control groups.

You want to keep the exclusion from your test associated with that test, so as not to impact other, unrelated tests in the same application.

The pseudocode might look something like...

var email = session.get("email_address")

// Look up the email from a remote service/db
var account = accountService.lookup(email);
var accountId = account ? account.id() : -1;
// UNREGISTERED, FREE, BASIC, PREMIUM
var level = account ? account.level() : Level.UNREGISTERED;

var identifiers = {
     "email": email,
     "accountId": accountId
}


// Add the lookup result to the proctor context
var proctorContext = ProctorContext.builder()
    .withAccountLevel(level)
    .build();

// Get the final assignment in all test groups, relying on each test's rules
//  to determine whether the identified user is placed in any group for that test.
var proctorResult = proctorContext.getProctorResult(request, response, identifiers);






Reply all
Reply to author
Forward
0 new messages