A further question arising from the above - why is...
# sdk-react
a
A further question arising from the above - why is the
trackingCallback
‘_required_’ for A/B testing? I’m struggling to see what I would be analysing.
r
@astonishing-window-33175 has opened an issue Close Issue button
Hello, Paul, GrowthBook doesn't track anything on its own (for data privacy and security reasons, among others), which is why you need to do it on your side via the ​`trackingCallback`​. The ​`trackingCallback`​ allows us to know what variation a user saw so that we can calculate the results.
a
Sorry, still don’t get it. How can GB select a variation to serve if it has to wait for the app to callback with the data? I really can’t follow the flow of events here.
r
Hi Paul, the process of assigning a user to a variation is deterministic, based on hashing, and happens on the fly; there's no data that needs to be stored related to assignment. Thus, we don't need to query a database to find out what to show the user. The ​`trackingCallback`​ is for analysis, so we can audit the assignments, but it's not part of the assignment flow. Does this help clear things up?
a
Yes, that helps a lot. I ran an A.B experiment and saw the callback called, so I assume that if I store the results somewhere that the GB Experiment Results tab can connect to then that allows the analysis within GB. BTW if I re-run an experiment with a new phase or whatever, then any given attribute used to target will always be served the same variation? i.e. I can’t get a single target to receive another unless the attribute is different.
r
Hi Paul, glad the explanation about the ​`trackingCallback`​ was helpful 😀 You are correct that GrowthBook can connect to your data store in order to run the analysis within GrowthBook. Let me double-check about attributes and targeting and I'll follow up with that info shortly.
👍 1
Hi again, Paul, Any given attribute used to target will ​*always*​ be served the same variation, assuming the Assignment ID is also the same. Targeting attributes are filters on those who are included in the test, though. Meeting that condition is a binary thing, and if they are included, then they are assigned experiments based on a hash of the ID and experiment name.
1
a
Hi, adding me to this thread, so GB won't start tracking if i don't set the
trackingCallback
? Isn't just using the GB Feature hook enough ?
r
Hi Benjamin, the capabilities for Feature Flagging can be used independently of tracking event data (like impressions) and analyzing that data. If you want to run an experiment and analyze the results, you'd need to implement the ​`trackingCallback()`​. If you just want to use Feature Flagging the hook would be enough.
a
Great, so I have to set a tracking callback for GB experiment data tracking, isn't it ?
r
Correct!
🙌 1