What would be the best way to support this type of...
# ask-questions
l
What would be the best way to support this type of experiment in GrowthBook? Let's say that only 70% of my users have language set to English and I want to test some UX changes in English only. I'm using the javascript SDK's trackingCallback() to track when users are put into an experiment in my analytics system. If our UX logic happens to call gb.isOn("myEnglishFlag") for a non-English user, would that cause them to be added to an experiment? Let's assume that we could have the user.language along with user.id available as attributes when initializing GrowthBook. I'm guessing we should either (a) use a "targeting condition" when setting the feature flag / experiment in GB dashboard or (b) add some logic to the trackingCallback() in our client to avoid sending experiment_viewed events for non-English users, otherwise we may be falsely reporting non-english users as part of the experiment_viewed. Thanks for any advice on this.
f
if you add targeting conditions to the feature flag rule, the users excluded by the targeting conditions would also be excluded from the experiment
you can also filter the results to just those English users on the experiment results side, if you don’t mind exposing everyone (by using segments)
l
Thanks @fresh-football-47124! We'll try the targeting conditions approach, sounds like it will keep things cleaner. Good to know about the segments option, nice to have the flexibility for after the fact analysis