@@ -141,7 +141,7 @@ def activate(experiment_key, user_id, attributes = nil)
141
141
# Create and dispatch impression event
142
142
experiment = config . get_experiment_from_key ( experiment_key )
143
143
send_impression (
144
- config , experiment , variation_key , '' , experiment_key ,
144
+ config , experiment , variation_key , '' , experiment_key , true ,
145
145
Optimizely ::DecisionService ::DECISION_SOURCES [ 'EXPERIMENT' ] , user_id , attributes
146
146
)
147
147
@@ -321,18 +321,18 @@ def is_feature_enabled(feature_flag_key, user_id, attributes = nil)
321
321
}
322
322
# Send event if Decision came from a feature test.
323
323
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
325
325
)
326
326
elsif decision . source == Optimizely ::DecisionService ::DECISION_SOURCES [ 'ROLLOUT' ] && config . send_flag_decisions
327
327
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
329
329
)
330
330
end
331
331
end
332
332
333
333
if decision . nil? && config . send_flag_decisions
334
334
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
336
336
)
337
337
end
338
338
@@ -879,7 +879,7 @@ def validate_instantiation_options
879
879
raise InvalidInputError , 'event_dispatcher'
880
880
end
881
881
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 )
883
883
if experiment . nil?
884
884
experiment = {
885
885
'id' => '' ,
@@ -903,7 +903,8 @@ def send_impression(config, experiment, variation_key, flag_key, rule_key, rule_
903
903
flag_key : flag_key ,
904
904
rule_key : rule_key ,
905
905
rule_type : rule_type ,
906
- variation_key : variation_key
906
+ variation_key : variation_key ,
907
+ enabled : enabled
907
908
}
908
909
909
910
user_event = UserEventFactory . create_impression_event ( config , experiment , variation_id , metadata , user_id , attributes )
0 commit comments