packages/optimizely-sdk/lib/core/bucketer/index.js
function(group, bucketingId, userId, logger) {
    var bucketingKey = sprintf('%s%s', bucketingId, group.id);
    var bucketValue = module.exports._generateBucketValue(bucketingKey);
    logger.log(LOG_LEVEL.DEBUG, sprintf(LOG_MESSAGES.USER_ASSIGNED_TO_EXPERIMENT_BUCKET, MODULE_NAME, bucketValue, userId));
    var trafficAllocationConfig = group.trafficAllocation;
    var bucketedExperimentId = module.exports._findBucket(bucketValue, trafficAllocationConfig);
    return bucketedExperimentId;
  }
function(group, bucketingId, userId, logger) {
    var bucketingKey = sprintf('%s%s', bucketingId, group.id);
    var bucketValue = module.exports._generateBucketValue(bucketingKey);
    logger.log(LOG_LEVEL.DEBUG, sprintf(LOG_MESSAGES.USER_ASSIGNED_TO_EXPERIMENT_BUCKET, MODULE_NAME, bucketValue, userId));
    var trafficAllocationConfig = group.trafficAllocation;
    var bucketedExperimentId = module.exports._findBucket(bucketValue, trafficAllocationConfig);
    return bucketedExperimentId;
  }
function ( group , bucketingId , userId , logger ) { var bucketingKey = sprintf ( '%s%s' , bucketingId , group . id ) ; var bucketValue = module . exports . _generateBucketValue ( bucketingKey ) ; logger . log ( LOG_LEVEL . DEBUG , sprintf ( LOG_MESSAGES . USER_ASSIGNED_TO_EXPERIMENT_BUCKET , MODULE_NAME , bucketValue , userId ) ) ; var trafficAllocationConfig = group . trafficAllocation ; var bucketedExperimentId = module . exports . _findBucket ( bucketValue , trafficAllocationConfig ) ; return bucketedExperimentId ; }
Returns bucketed experiment ID to compare against experiment user is being called into
@param {Object} group        Group that experiment is in
@param {string} bucketingId  Bucketing ID
@param {string} userId       ID of user to be bucketed into experiment
@param {Object} logger       Logger implementation
@return {string} ID of experiment if user is bucketed into experiment within the group, null otherwise
Returns bucketed experiment ID to compare against experiment user is being called into