Question
There are scenarios when there is a need to calculate treatment without specifying a user id, for example, when using a feature flag as a 100% feature toggle; either On or Off. Is there a way to omit the user id from the getTreatment
call?
Answer
The getTreatment
function requires a customer id, which is usually a hash representation of a the current session's customer. The SDK uses the customer id when the feature flag includes percentage based targeting rules (for example 50% on and 50% off).
In this case this is not relevant since we are assigning 100% of a single treatment. However, the SDK still requires the customer id to calculate the treatment.
If the implementation will not use percentage based treatments, then apply a dummy customer id with any string value.
Comments
0 comments
Please sign in to leave a comment.