Hi GrowthBook team, for exposure tracking - do you...
# ask-questions
h
Hi GrowthBook team, for exposure tracking - do you suggest that all feature flags share the same event name and can be differentiated with the experimentId? or do you suggest that each feature flag would be called differently in the
analytics.track
call?
f
Yes, we usually recommend a single event name like "viewed experiment"
h
Got it. and then just pass the feature flag id and name?
Also, how do I pass the attributes that I am using for flag evaluation? For example for feature 1, I am turning on and off based on location, for feature 2, I am turning on and off based on user ID. Is there a way to pass the location and user ID info in the track call?
f
A single feature flag can have multiple experiments, so you should primarily use the experiment tracking key, not the feature id, in your tracking calls. The other required property is the variation id. Besides those, you can add whatever other info you want. If you're using Segment.io, they already add a bunch of useful properties automatically such as geo and browser info
👍 1
h
Got it. So this event fires each time a user is exposed to the feature flag, and we can add whatever info we want in the payload.
What if it is not an "experiment" per se? do all feature flag have also an experiment tracking key?
f
The only time trackingCallback is called is if the user is assigned a feature flag value based on an experiment. If you use a different type of rule like a Force rule or Percent Rollout, the callback is not fired. Same if there are no matching rules and the user falls back to the default value, no callbacks are fired.
h
oh interesting... my use case is that I want to assign it to specific group of users (for example, all users in stores 1, 4 and 7) . Would this be considered as a Force rule? If so, how do I track feature flag exposure?
@future-teacher-7046 Happy Monday! Could you please help me figure out how to track exposure?
f
Sorry for the delay. The GrowthBook SDK does not support tracking for non-random assignments for A/B tests right now. You can still use GrowthBook to force different variations and view results, you will just need to manually fire
analytics.track
calls on exposure.
f
should we use track calls or have a json attribute in identify for all experiment id / variant id pairs?
we cn then also pass this as context in track calls to get point in time flags for a user?
@future-teacher-7046 thoughts^?