@@ -195,10 +195,10 @@ private function validateUserInputs($attributes, $eventTags = null)
195
195
* @param array Associative array of user attributes
196
196
* @param DatafileProjectConfig DatafileProjectConfig instance
197
197
*/
198
- protected function sendImpressionEvent ($ config , $ experimentKey , $ variationKey , $ flagKey , $ ruleKey , $ ruleType , $ userId , $ attributes )
198
+ protected function sendImpressionEvent ($ config , $ experimentKey , $ variationKey , $ flagKey , $ ruleKey , $ ruleType , $ enabled , $ userId , $ attributes )
199
199
{
200
200
$ impressionEvent = $ this ->_eventBuilder
201
- ->createImpressionEvent ($ config , $ experimentKey , $ variationKey , $ flagKey , $ ruleKey , $ ruleType , $ userId , $ attributes );
201
+ ->createImpressionEvent ($ config , $ experimentKey , $ variationKey , $ flagKey , $ ruleKey , $ ruleType , $ enabled , $ userId , $ attributes );
202
202
$ this ->_logger ->log (Logger::INFO , sprintf ('Activating user "%s" in experiment "%s". ' , $ userId , $ experimentKey ));
203
203
$ this ->_logger ->log (
204
204
Logger::DEBUG ,
@@ -274,7 +274,7 @@ public function activate($experimentKey, $userId, $attributes = null)
274
274
return null ;
275
275
}
276
276
277
- $ this ->sendImpressionEvent ($ config , $ experimentKey , $ variationKey , '' , $ experimentKey , FeatureDecision::DECITION_SOURCE_EXPERIMENT , $ userId , $ attributes );
277
+ $ this ->sendImpressionEvent ($ config , $ experimentKey , $ variationKey , '' , $ experimentKey , FeatureDecision::DECITION_SOURCE_EXPERIMENT , true , $ userId , $ attributes );
278
278
279
279
return $ variationKey ;
280
280
}
@@ -556,8 +556,11 @@ public function isFeatureEnabled($featureFlagKey, $userId, $attributes = null)
556
556
$ variation = $ decision ->getVariation ();
557
557
558
558
if ($ config ->getSendFlagDecisions () && ($ decision ->getSource () == FeatureDecision::DECISION_SOURCE_ROLLOUT || !$ variation )) {
559
+ if ($ variation ) {
560
+ $ featureEnabled = $ variation ->getFeatureEnabled ();
561
+ }
559
562
$ ruleKey = $ decision ->getExperiment () ? $ decision ->getExperiment ()->getKey () : '' ;
560
- $ this ->sendImpressionEvent ($ config , $ ruleKey , $ variation ? $ variation ->getKey () : '' , $ featureFlagKey , $ ruleKey , $ decision ->getSource (), $ userId , $ attributes );
563
+ $ this ->sendImpressionEvent ($ config , $ ruleKey , $ variation ? $ variation ->getKey () : '' , $ featureFlagKey , $ ruleKey , $ decision ->getSource (), $ featureEnabled , $ userId , $ attributes );
561
564
}
562
565
563
566
if ($ variation ) {
@@ -569,7 +572,7 @@ public function isFeatureEnabled($featureFlagKey, $userId, $attributes = null)
569
572
'variationKey ' => $ variation ->getKey ()
570
573
);
571
574
572
- $ this ->sendImpressionEvent ($ config , $ experimentKey , $ variation ->getKey (), $ featureFlagKey , $ experimentKey , $ decision ->getSource (), $ userId , $ attributes );
575
+ $ this ->sendImpressionEvent ($ config , $ experimentKey , $ variation ->getKey (), $ featureFlagKey , $ experimentKey , $ decision ->getSource (), $ featureEnabled , $ userId , $ attributes );
573
576
} else {
574
577
$ this ->_logger ->log (Logger::INFO , "The user ' {$ userId }' is not being experimented on Feature Flag ' {$ featureFlagKey }'. " );
575
578
}
0 commit comments