@@ -195,10 +195,10 @@ private function validateUserInputs($attributes, $eventTags = null)
195195 * @param array Associative array of user attributes
196196 * @param DatafileProjectConfig DatafileProjectConfig instance
197197 */
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 )
199199 {
200200 $ impressionEvent = $ this ->_eventBuilder
201- ->createImpressionEvent ($ config , $ experimentKey , $ variationKey , $ flagKey , $ ruleKey , $ ruleType , $ userId , $ attributes );
201+ ->createImpressionEvent ($ config , $ experimentKey , $ variationKey , $ flagKey , $ ruleKey , $ ruleType , $ enabled , $ userId , $ attributes );
202202 $ this ->_logger ->log (Logger::INFO , sprintf ('Activating user "%s" in experiment "%s". ' , $ userId , $ experimentKey ));
203203 $ this ->_logger ->log (
204204 Logger::DEBUG ,
@@ -274,7 +274,7 @@ public function activate($experimentKey, $userId, $attributes = null)
274274 return null ;
275275 }
276276
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 );
278278
279279 return $ variationKey ;
280280 }
@@ -556,8 +556,11 @@ public function isFeatureEnabled($featureFlagKey, $userId, $attributes = null)
556556 $ variation = $ decision ->getVariation ();
557557
558558 if ($ config ->getSendFlagDecisions () && ($ decision ->getSource () == FeatureDecision::DECISION_SOURCE_ROLLOUT || !$ variation )) {
559+ if ($ variation ) {
560+ $ featureEnabled = $ variation ->getFeatureEnabled ();
561+ }
559562 $ 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 );
561564 }
562565
563566 if ($ variation ) {
@@ -569,7 +572,7 @@ public function isFeatureEnabled($featureFlagKey, $userId, $attributes = null)
569572 'variationKey ' => $ variation ->getKey ()
570573 );
571574
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 );
573576 } else {
574577 $ this ->_logger ->log (Logger::INFO , "The user ' {$ userId }' is not being experimented on Feature Flag ' {$ featureFlagKey }'. " );
575578 }
0 commit comments