Hi, I have a questions about user_id vs anonymous_...
# ask-questions
f
Hi, I have a questions about user_id vs anonymous_ids, we use rudderstack to send experiment_viewed events to bigquery. Rudderstack sends a user_id (logged in user id from our system) and an anonymous_id as columns in the experiement_viewed row. What then should we send to Growth book via the javascript setAttributes() function as the id parameter? should we send the user_id (logged in user id) or the anonymous_id or both?
f
You should set both attributes. When you run an experiment, you choose which attribute you want to use to split traffic.
f
ok and obviously sometimes the user_id will be null because the user isn't logged in, should I just send a null value to set attributes for that parameter?
f
Yeah, null is fine. If you choose user id as the attribute for an experiment, it will skip anyone with null (or another falsy value)
f
so if we want to split traffic on say all users, we'd just split based on the anon_id (which all users have)