@@ -308,7 +308,8 @@ public Variation GetVariation(string experimentKey, string userId, UserAttribute
308308 } ;
309309
310310 userAttributes = userAttributes ?? new UserAttributes ( ) ;
311- NotificationCenter . SendNotifications ( NotificationCenter . NotificationType . Decision , DecisionInfoTypes . EXPERIMENT , userId ,
311+ var decisionNotificationType = Config . IsFeatureExperiment ( experiment . Id ) ? DecisionNotificationTypes . FEATURE_TEST : DecisionNotificationTypes . AB_TEST ;
312+ NotificationCenter . SendNotifications ( NotificationCenter . NotificationType . Decision , decisionNotificationType , userId ,
312313 userAttributes , decisionInfo ) ;
313314 return variation ;
314315 }
@@ -380,20 +381,19 @@ public virtual bool IsFeatureEnabled(string featureKey, string userId, UserAttri
380381 if ( ! Validator . IsFeatureFlagValid ( Config , featureFlag ) )
381382 return false ;
382383
383- string experimentKey = null ;
384- string variationKey = null ;
385384 bool featureEnabled = false ;
385+ var sourceInfo = new Dictionary < string , string > ( ) ;
386386 var decision = DecisionService . GetVariationForFeature ( featureFlag , userId , userAttributes ) ;
387387
388388 if ( decision . Variation != null )
389389 {
390390 var variation = decision . Variation ;
391391 featureEnabled = variation . FeatureEnabled . GetValueOrDefault ( ) ;
392392
393- if ( decision . Source == FeatureDecision . DECISION_SOURCE_EXPERIMENT )
393+ if ( decision . Source == FeatureDecision . DECISION_SOURCE_FEATURE_TEST )
394394 {
395- experimentKey = decision . Experiment . Key ;
396- variationKey = variation . Key ;
395+ sourceInfo [ " experimentKey" ] = decision . Experiment . Key ;
396+ sourceInfo [ " variationKey" ] = variation . Key ;
397397 SendImpressionEvent ( decision . Experiment , variation , userId , userAttributes ) ;
398398 }
399399 else
@@ -412,11 +412,10 @@ public virtual bool IsFeatureEnabled(string featureKey, string userId, UserAttri
412412 { "featureKey" , featureKey } ,
413413 { "featureEnabled" , featureEnabled } ,
414414 { "source" , decision . Source } ,
415- { "sourceExperimentKey" , experimentKey } ,
416- { "sourceVariationKey" , variationKey } ,
415+ { "sourceInfo" , sourceInfo } ,
417416 } ;
418417
419- NotificationCenter . SendNotifications ( NotificationCenter . NotificationType . Decision , DecisionInfoTypes . FEATURE , userId ,
418+ NotificationCenter . SendNotifications ( NotificationCenter . NotificationType . Decision , DecisionNotificationTypes . FEATURE , userId ,
420419 userAttributes ?? new UserAttributes ( ) , decisionInfo ) ;
421420 return featureEnabled ;
422421 }
@@ -494,12 +493,11 @@ public virtual T GetFeatureVariableValueForType<T>(string featureKey, string var
494493 $@ "User ""{ userId } "" is not in any variation for feature flag ""{ featureKey } "", returning default value ""{ variableValue } "".") ;
495494 }
496495
497- string experimentKey = null ;
498- string variationKey = null ;
499- if ( decision ? . Source == FeatureDecision . DECISION_SOURCE_EXPERIMENT )
496+ var sourceInfo = new Dictionary < string , string > ( ) ;
497+ if ( decision ? . Source == FeatureDecision . DECISION_SOURCE_FEATURE_TEST )
500498 {
501- experimentKey = decision . Experiment . Key ;
502- variationKey = decision . Variation . Key ;
499+ sourceInfo [ " experimentKey" ] = decision . Experiment . Key ;
500+ sourceInfo [ " variationKey" ] = decision . Variation . Key ;
503501 }
504502
505503 var typeCastedValue = GetTypeCastedVariableValue ( variableValue , variableType ) ;
@@ -511,11 +509,10 @@ public virtual T GetFeatureVariableValueForType<T>(string featureKey, string var
511509 { "variableValue" , typeCastedValue } ,
512510 { "variableType" , variableType . ToString ( ) . ToLower ( ) } ,
513511 { "source" , decision ? . Source } ,
514- { "sourceExperimentKey" , experimentKey } ,
515- { "sourceVariationKey" , variationKey } ,
512+ { "sourceInfo" , sourceInfo } ,
516513 } ;
517514
518- NotificationCenter . SendNotifications ( NotificationCenter . NotificationType . Decision , DecisionInfoTypes . FEATURE_VARIABLE , userId ,
515+ NotificationCenter . SendNotifications ( NotificationCenter . NotificationType . Decision , DecisionNotificationTypes . FEATURE_VARIABLE , userId ,
519516 userAttributes ?? new UserAttributes ( ) , decisionInfo ) ;
520517 return ( T ) typeCastedValue ;
521518 }
0 commit comments