Hey, we implemented Growthbook using <https://docs...
# ask-questions
r
Hey, we implemented Growthbook using https://docs.growthbook.io/lib/react, Next.js to be specific. And we're not able to get any in our experiment. Growthbook is implmented on prusa3d.com. The experiment is up and running, however, it doesn't initiate any events - BigQuery is still empty. Any tips on what we should change?
The experiment is up running, however, it doesn't initiate any events in dataLayer or in GTAG. Therefore the events are not collected in GA4 so it can't be sent to BigQuery.
@fresh-football-47124, is this the right place to ask? Or should I file some official ticket? We are ready to start using growthbook at prusa3d.com. But we still need a bit of help and love.
f
Hi Jan, apologies for the delayed response here. We will need a few things from you in order to debug. Please, can you confirm if the experiment was created using the Visual Editor? Also, please can you enable DevMode so that we can use DevTools and review your experiment?
We will also need to review your trackingCallback to see how you implemented.
v
Hi @flaky-noon-11399, We’re happy to enable the
devMode
for you. However, before we proceed… We were informed that there’s no need to handle
trackingCallback
on our end, as it supposedly "works out of the box," so we haven’t included it in our code at all. To be honest, I was a bit skeptical about that statement, but could the issue actually be that we’re missing the script tag in the
<head>
? I assumed it wouldn’t be necessary for a React implementation.
f
Hi Roman, when you go to the SDK connections, which SDK do you have enabled? Only the HTML Script tag SDK has the trackingCallback inbuilt, but for the React SDK you'll need to configure the trackingCallback- https://docs.growthbook.io/lib/react#step-1-configure-your-app
The
trackingCallback
is called every time a user is put into an experiment. It allows you to track the exposure event and records which variation of an experiment a user has been assigned to. With the trackingCallback not in your implementation, this would be the reason you are not seeing data. Linked above is the React SDK trackingCallback implementation, please can you review your code in accordance with the doc?
v
The SDK connections are for React. What’s less clear is the behavior of the
trackingCallback
. Our data analyst mentioned that GA4 is pulling data from BigQuery, and that by default, GrowthBook should be sending this data directly to BigQuery without needing a
trackingCallback
. So, the question is: Are we expected to send the data to GA4 or BigQuery directly from our frontend?
f
The data gets sent to GA4 and from there it is sent to BigQuery and then from BigQuery to GrowthBook
The trackingCallback will track the experiment_viewed event to GA4
v
Alright, so we need to create a new event in GA4, send it from the React app, and proceed from there.
Thank you, we will try that and get to you if it doesn't work! 🙇
f
Yeah once you implement the TrackingCallback, please also review that GA4 is connected correctly and the experiment_viewed event will be tracked
🙌 1
v
We’re already using GA4 for several other events, so it should work just fine 😄
f
Ah perfect, my pleasure to assist and we are on hand if you face any blockers 🙏
❤️ 1