Hi, what would be the best way to add conditional ...
# sdk-react
g
Hi, what would be the best way to add conditional feature checks, lets say I have made new "sold out" options for products thats sold out, we want to run an experiment on this new feature and track if the new options are better, but we only want to check to see if the feature is on / off when the sold out criteria is meet. There are other parts besides the sold out part that changes depending on this feature due to structure of the code. We currently useFeatureIsOn, but can't seem to figure out how to make it conditional, which I assume wouldn't be possible with the hook, but maybe some other form of feature check that also fits the tracking part as we only want to track the viewed experiment if it actual hit the criteria.
r
Hi Poul, I apologize for the delay in getting back to you due to the end-of-year holiday period. I want to make sure I understand the use case. You want to run an experiment that includes feature flags, but you only want the experiment to run for products that are sold out. Is that right? If this is correct, how are you detecting that the product is sold out? Are you running the experiment only on certain web pages, or on all web pages and then trying to filter for sold-out products?
g
Thanks for getting back August, we managed to figure it out :)