Skip to content

Commit ebb1b7d

Browse files
update: Add support for CMAB traffic allocation in bucketing logic
1 parent 761bc43 commit ebb1b7d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/optimizely/bucketer.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ def bucket_to_entity_id(project_config, experiment, bucketing_id, user_id)
103103
end
104104

105105
traffic_allocations = experiment['trafficAllocation']
106+
if experiment['cmab']
107+
traffic_allocations = [
108+
{
109+
entityId: '$',
110+
endOfRange: experiment['cmab']['trafficAllocation']
111+
}
112+
]
113+
end
106114
variation_id, find_bucket_reasons = find_bucket(bucketing_id, user_id, experiment_id, traffic_allocations)
107115
decide_reasons.push(*find_bucket_reasons)
108116

0 commit comments

Comments
 (0)