We just started using GrowthBook for Features/ab t...
# ask-questions
p
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
that is not right
can you share the code you’re using for the SDK?
p
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
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
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
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
Thank you! I refactored to use
trackingCallback
to send to our analytics and it seems to be splitting more evenly now.