Hey everyone, QQ: how to send the `id` for growthb...
# announcements
b
Hey everyone, QQ: how to send the
id
for growthbook (in
setAttributes
) to match the segment one? I tried to send the
ajs_anonymous_id
/
ajs_user_id
as an id. but the problem is those segment cookies are set after growthbook config initialization! Thanks.
f
You can call setAtrributes multiple times. So if you can listen for when segment initializes you can update the attributes to include the id.
b
Thanks @future-teacher-7046 Ah, I thought about that but what happens if I initialized it with a random string as
id
and then I change it to have the segment Id... will that counts as 2 different users that might have two diff experiments?
f
Yes, probably better to initialize as an empty string or null. Then the user won't be part of the experiment until the id is set for real.
b
Got it. Thanks 🙌