Hello Team I have a question about how Percentage...
# ask-questions
Hello Team I have a question about how Percentage Rollout option work for feature flags. I noticed that rules are fetched from GrowthBook CDN and rules are evaluated within your SDK on browser-side (I'm using javascript sdk). If a feature is to be shown to 50% of end users i.e. 50% users will be shown image with background color A and another 50% will be shown image with background color B, how does GB app know the statistics of how many users have been shown background color A vs B to maintain 50% ratio here ?
Hi Paras, thanks for reaching out. GrowthBook assigns users to variations based on deterministic hashing. We create a hash out of the unique identifier for the user (usually something like ​​`user­­_id`​​ or ​​`device­­_id`​​) and the experiment key. You can read more about the methodology here: ­https://docs.growthbook.io/lib/js#hashing
I still have some doubts, let's take the below example: I have 100 users who would visit my website, I have two variations to show - A and B. There's a chance that based on user_id/device_id hash - majority of hash values are generated <0.5 on 0 to 1 scale while my rule says 50% of users should see variation A and another 50% should see variation B. This is a discrepancy. GrowthBook app should be able to record data about how many users are being served variation A vs variation B but I don't see any such network call with Javascript sdk since the evaluation is on SDK side and no POST call to GB app afterwards.
On average it will be 50%, not exactly 50/50. This is standard for most experimentation platforms as it allows you to deterministically map an id to a feature variation without having to do expensive lookups and rebalancing.
Thank you Luke. It's clear now