Hi guys, I have issues with Nextjs+Growthbook impl...
# ask-questions
m
Hi guys, I have issues with Nextjs+Growthbook implementation. We are following this example and on local env "trackingCallback" is not triggered. It works fine on prod at the moment, and it was working fine on local env some time ago too. Who can give a hint where to look at to fix the problem? Most confusing thing is that code which relies on feature flag works fine locally - experiment is shown on local machine. It's just callback not triggered.
f
huh
m
hey 😉
f
do you have an experiment served locally in the features json?
m
no, everything is setup in Growthbook dashboard
f
I mean, each environment serves a diff payload
m
oh.. for all envs we are using 1 env of growthbook. I mean same host, and client key
and experiment is straightforward - 50/50 traffic, 1 boolean feature flag.
f
which SDK are you using?
m
SDK Connections - React 1.2.1
and in the app it's
Copy code
"@growthbook/growthbook": "^1.4.1",
"@growthbook/growthbook-react": "^1.4.1",
and I can say for sure - issue is not only on my machine - I asked teammate to check from his side - he has same behavior.
a
@modern-ocean-57629 you should use the different client keys for different envs. You will need to add different SDK connections for each envs on GrowthBook dashboard.
f
how are you seeing the trackingCallback not being called?
I wonder if setting the dev mode is blocking the callback
m
@agreeable-train-79582 hi! Issue is not with GB setup and not with experiments - it's about not getting
trackingCallback
called from the library while experiment is shown
if setting the dev mode is blocking the callback
I tried locally disabling it.. it doesn't help
@agreeable-train-79582, @fresh-football-47124 is it possible that Visual Editor messes up with the normal work of callback?
we have set up 1 experiment which evaluates js code on some pages.
@fresh-football-47124, @agreeable-train-79582 I've disabled visual experiments. And created separate SDK connection for each env. But SDK does not see experiments at all. This is why
trackingCallback
does not work. Previously it saw experiment which we ran for about 2 months. What has changed - I upgraded version of the SDK to 1.4.1 and added 2 new experiments - one with feature flag and second is Visual experiment. Any ideas what's going on?