@@ -141,7 +141,7 @@ def activate(experiment_key, user_id, attributes = nil)
141141 # Create and dispatch impression event
142142 experiment = config . get_experiment_from_key ( experiment_key )
143143 send_impression (
144- config , experiment , variation_key , '' , experiment_key ,
144+ config , experiment , variation_key , '' , experiment_key , true ,
145145 Optimizely ::DecisionService ::DECISION_SOURCES [ 'EXPERIMENT' ] , user_id , attributes
146146 )
147147
@@ -321,18 +321,18 @@ def is_feature_enabled(feature_flag_key, user_id, attributes = nil)
321321 }
322322 # Send event if Decision came from a feature test.
323323 send_impression (
324- config , decision . experiment , variation [ 'key' ] , feature_flag_key , decision . experiment [ 'key' ] , source_string , user_id , attributes
324+ config , decision . experiment , variation [ 'key' ] , feature_flag_key , decision . experiment [ 'key' ] , feature_enabled , source_string , user_id , attributes
325325 )
326326 elsif decision . source == Optimizely ::DecisionService ::DECISION_SOURCES [ 'ROLLOUT' ] && config . send_flag_decisions
327327 send_impression (
328- config , decision . experiment , variation [ 'key' ] , feature_flag_key , decision . experiment [ 'key' ] , source_string , user_id , attributes
328+ config , decision . experiment , variation [ 'key' ] , feature_flag_key , decision . experiment [ 'key' ] , feature_enabled , source_string , user_id , attributes
329329 )
330330 end
331331 end
332332
333333 if decision . nil? && config . send_flag_decisions
334334 send_impression (
335- config , nil , '' , feature_flag_key , '' , source_string , user_id , attributes
335+ config , nil , '' , feature_flag_key , '' , feature_enabled , source_string , user_id , attributes
336336 )
337337 end
338338
@@ -879,7 +879,7 @@ def validate_instantiation_options
879879 raise InvalidInputError , 'event_dispatcher'
880880 end
881881
882- def send_impression ( config , experiment , variation_key , flag_key , rule_key , rule_type , user_id , attributes = nil )
882+ def send_impression ( config , experiment , variation_key , flag_key , rule_key , enabled , rule_type , user_id , attributes = nil )
883883 if experiment . nil?
884884 experiment = {
885885 'id' => '' ,
@@ -903,7 +903,8 @@ def send_impression(config, experiment, variation_key, flag_key, rule_key, rule_
903903 flag_key : flag_key ,
904904 rule_key : rule_key ,
905905 rule_type : rule_type ,
906- variation_key : variation_key
906+ variation_key : variation_key ,
907+ enabled : enabled
907908 }
908909
909910 user_event = UserEventFactory . create_impression_event ( config , experiment , variation_id , metadata , user_id , attributes )
0 commit comments