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:
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:
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