https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
g

gorgeous-toddler-76645

07/10/2023, 1:39 AM
Hi everyone, I'm new to GrowthBook. I have read the documentation, but I still have a question about
trackingCallback
. Based on the docs, does this event get triggered only once when we create an instance?
f

fresh-football-47124

07/10/2023, 1:40 AM
it will get triggered when a user is placed into an experiment, because of an experiment rule (or inline experiment)
g

gorgeous-toddler-76645

07/10/2023, 1:43 AM
But what if I want to fire our event when I click a button? Is there any callback I can use?
f

fresh-football-47124

07/10/2023, 1:44 AM
what event is this? like tracking the button click?
g

gorgeous-toddler-76645

07/10/2023, 1:45 AM
Internal event for tracking data. That event will be trigger when I click the button
f

fresh-football-47124

07/10/2023, 1:46 AM
yes, so the way GrowthBook works is that all additional events on clicks or page views or whatever, will be joined by a user attribute (usually an id) to the experiment exposure event, on the experiment report
so you only need to add that one additional event on the trackingCallback, and leave all your other event tracking as you have it
g

gorgeous-toddler-76645

07/10/2023, 1:49 AM
Oh I see. Thank you. Going to test it around. Is there any videos about it ?
f

fresh-football-47124

07/10/2023, 1:49 AM
there are a few that give an overview of how it works
but they don’t go in to too much detail
we’d be happy to meet if you run into any trouble or have any questions
g

gorgeous-toddler-76645

07/10/2023, 1:50 AM
Thanks! I will check these out👍
b

better-bird-41546

07/12/2023, 12:58 PM
@fresh-football-47124 what if I want to send the tracking callback only when the user is actually seeing the experiment and not when it gets allocated? I would want to avoid a situation whereby a user gets allocated to an experiment, tracking is sent but during the journey or test duration he/she never actually get to experience the control/variation because for instance doesn't go on the page/app screen where the change is
f

fresh-football-47124

07/12/2023, 9:03 PM
you can use activation metrics for that use case
14 Views