bitter-salesclerk-96251
05/12/2025, 12:56 PMbitter-salesclerk-96251
05/12/2025, 12:56 PMstrong-mouse-55694
05/12/2025, 1:24 PMbitter-salesclerk-96251
05/12/2025, 3:35 PMbitter-salesclerk-96251
05/12/2025, 3:46 PMbitter-salesclerk-96251
05/12/2025, 3:47 PMstrong-mouse-55694
05/12/2025, 4:14 PMbitter-salesclerk-96251
05/12/2025, 5:58 PMbitter-salesclerk-96251
05/12/2025, 5:58 PMstrong-mouse-55694
05/12/2025, 6:17 PMbitter-salesclerk-96251
05/13/2025, 4:37 PMbitter-salesclerk-96251
05/13/2025, 4:37 PMstrong-mouse-55694
05/13/2025, 5:22 PMGroove Test - RedCloseoutButton
in your API response. However, I can also see that it's not being passed to the SDK, which is why it isn't showing up. I think you had some custom logic, so you need to not only pass features
but also experiments
in order for things to work.
You can see your raw API response here (what's being sent to your site): https://cdn.growthbook.io/api/features/sdk-z2eQdvHSoRomlSFH With Dev Tools, you can compare what it's getting (SDK → SDK Payload) and see that the experiments property is empty.
With the other visual experiment, I'd need more details to understand why it's not included in the payload.bitter-salesclerk-96251
05/13/2025, 5:23 PMbitter-salesclerk-96251
05/13/2025, 5:28 PMconst response = await fetch(`<https://cdn.growthbook.io/api/features/sdk-z2eQdvHSoRomlSFH>`);
const { features } = await response.json();
// Initialize GrowthBook with the features
const pluginOptions = {
trackers: ["gtag"]
}
const gb = new GrowthBook({
enableDevMode: true,
features,
experiments,
apiHost: "<https://cdn.growthbook.io>",
clientKey: "sdk-z2eQdvHSoRomlSFH",
plugins: [
thirdPartyTrackingPlugin(pluginOptions),
],
attributes: {
id: visitor_id, // Use the anonymous ID for user identification
}
});
bitter-salesclerk-96251
05/13/2025, 5:29 PMbitter-salesclerk-96251
05/13/2025, 5:29 PMstrong-mouse-55694
05/13/2025, 5:50 PMconst { features, experiments } = await response.json();
I know you're using this custom logic because of some particular needs with your app, but I think you'd likely face fewer challenges following the path laid out in the docs. It'd handle all of this data fetching (caching, etc.) for you.bitter-salesclerk-96251
05/13/2025, 6:00 PMbitter-salesclerk-96251
05/13/2025, 6:01 PMconst response = await fetch(`<https://cdn.growthbook.io/api/features/sdk-z2eQdvHSoRomlSFH>`);
const { features } = await response.json();
// Initialize GrowthBook with the features
const pluginOptions = {
trackers: ["gtag"]
}
const gb = new GrowthBook({
enableDevMode: true,
features,
apiHost: "<https://cdn.growthbook.io>",
clientKey: "sdk-z2eQdvHSoRomlSFH",
plugins: [
thirdPartyTrackingPlugin(pluginOptions),
],
attributes: {
id: visitor_id, // Use the anonymous ID for user identification
}
});
await gb.init({
timeout: 2000,
streaming: true // replaces autoRefresh
});
strong-mouse-55694
05/13/2025, 7:18 PM