https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
p

polite-art-41130

07/21/2023, 5:30 PM
We just started using GrowthBook for Features/ab tests, and our having trouble splitting users. We are using Segment's anonymous id to identify our users. We created an A/B experiment under a feature and split control and variant by 50/50. However, users are getting tagged more with the control almost 88% compared to 11% for the variant. Has anyone run into this problem before? Any help or advice would be most appreciated, thanks!
f

fresh-football-47124

07/21/2023, 8:44 PM
that is not right
can you share the code you’re using for the SDK?
p

polite-art-41130

07/22/2023, 12:06 AM
Sure! Here is the code we have for loading growthbook and experiments
Copy code
const growthbookInstance = new GrowthBook({
    apiHost: process.env.NUXT_ENV_GROWTHBOOK_URL,
    clientKey: process.env.NUXT_ENV_GROWTHBOOK_KEY,
    attributes: {
      id: segmentData, // Segment anon id 
    },
    enableDevMode: isDev,
  });

  await growthbookInstance.loadFeatures({ autoRefresh: true });

  const expVariant = growthbookInstance.getFeatureValue('exp_example', '0');
f

fresh-football-47124

07/22/2023, 3:51 PM
you are not using the trackingCallback?
I think if you use
Copy code
const result = gb.evalFeature("exp_example");
console.log(result);
You’ll notice that sometimes the experiment isn’t loading and it’s serving the default value. https://docs.growthbook.io/lib/js#evalfeature
p

polite-art-41130

07/24/2023, 4:27 PM
We are not using trackingCallback. Instead after the experiment loads we pass that to our analytics since we have other experiments running with Optimize still. Thank you for sharing
evalFeature
. I will add that and see if that helps to debug.
f

fresh-football-47124

07/24/2023, 5:11 PM
I have a feeling that without using the trackingCallback, you’re getting users who are getting a specific value without being included in the experiment
p

polite-art-41130

07/24/2023, 9:31 PM
Thank you! I refactored to use
trackingCallback
to send to our analytics and it seems to be splitting more evenly now.
16 Views