I have set up an A/B experiment through Features i...
# ask-questions
v
I have set up an A/B experiment through Features in Growthbookl. I am making an api call in the tracking callback. Every thing runs fine but now I have turned off the feature from the growthbook account and the tracking callback is still firing every time i load the page. Here is my code for the tracking callback:
Copy code
const growthbook = new GrowthBook({
  apiHost: '<https://cdn.growthbook.io>',
  clientKey: growthbookClientKey,
  trackingCallback: (experiment, result) => {
    ajaxPromise({
      url: '/api/google-analytic/send-rd-event',
      type: 'POST',
      data: {
        category: eventCategory.AB_TEST,
        action: eventAction.EXPERIMENT_VIEWED,
        label: experiment.key,
        value: result.variationId,
      },
    });
  },
});
And here is how i use the feature:
Copy code
const feature_value = useFeatureValue(
    AB_TEST_EXPERIMENTS.EDPRESSO_AA_TEST_ID,
    'fallback',
  );

React.useEffect(() => {
    const loadFeatures = async () => {
      await growthbook?.loadFeatures({
        autoRefresh: true,
        timeout: 2000,
      });
    };
    try {
      loadFeatures();
    } catch (error) {
      sendErrorEvent(error);
    }
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);
Note: I am using the react sdk
1
r
@blue-sundown-32899 has marked the issue as closed. Reopen Issue button
f
Hi Fatima
when you turned off the feature, how did you do it? Was it through feature flags or with the visual editor?
Can you see the experiment defined in the SDK payload you get from the SDK endpoint?
v
yes i can see the experiment in the sdk payload. I turned off the feature through the toggle on this page
r
Hello, Fatima, I believe you have stumbled across a bug that's on our radar. Sometimes changes to the experiment don't trigger a regeneration of the payload. We are working on fixing this, and I apologize for the inconvenience. In the meantime, a workaround would be to remove the rule from the feature, then save and publish to force the payload to regenerate.
👍 1