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

flaky-church-68788

09/08/2022, 3:20 PM
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

future-teacher-7046

09/08/2022, 3:21 PM
You should set both attributes. When you run an experiment, you choose which attribute you want to use to split traffic.
f

flaky-church-68788

09/08/2022, 3:22 PM
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

future-teacher-7046

09/08/2022, 3:23 PM
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

flaky-church-68788

09/08/2022, 3:42 PM
so if we want to split traffic on say all users, we'd just split based on the anon_id (which all users have)
7 Views