https://www.growthbook.io/ logo
s

silly-dinner-68354

06/03/2022, 6:58 AM
Hello 👋 I'm investigating GrowthBook for work, we're currently using LaunchDarkly but not very satisfied. Something we struggle with in LD is how to handle the mobile situation where we want to use the device OS as a condition, but potentially a single user may have multiple devices of varying OS. Targeting attributes look like they're tied to a single user ID, I assume (like LD) if that user logs into an Android device and then into an iOS device, only the latest call to
setAttributes
will be reflected. We ended up using a stable unique-per-device identifier as the user ID, but it makes LD pretty unpleasant to use. Is this something GrowthBook has come across? Do other people handle this situation differently? Would really appreciate any battle stories. 🙂
f

fresh-football-47124

06/03/2022, 7:08 AM
Hi Jonathan, welcome. 👋
Targeting with GrowthBook can use arbitrary attributes, so you could do OS + user id if you want... I'm not sure I entirely understand your use case for this kind of targeting, can you elaborate on the problem you're solving for?
s

silly-dinner-68354

06/03/2022, 7:25 AM
Users can log into multiple devices with their account, for example they may have a personal device and they may have a front-of-house device in their store. Those two devices may be running different operating systems. So if we wanted to target features at user1+android but not user1+ios, would that be possible? My understanding of the targeting attributes documentation is that for each user ID there is only a single set of targeting attributes (whatever was passed in the most recent call to
setAttributes
).
f

fresh-football-47124

06/03/2022, 7:26 AM
yes, that is true, but you can target feature flags to any number of attributes
something like that, (depending on how many users you're targeting)
s

silly-dinner-68354

06/03/2022, 7:40 AM
Yeah, but if the order in which you sign into the devices affects whether the flag will be on/off for your user, that's obviously not very reliable.
If the flag condition is
OS is not "android"
and I logged into the iOS device most recently, then presumably the behaviour of that condition will be affected on the Android device too.
f

fresh-football-47124

06/03/2022, 7:42 AM
How would you like it to behave?
s

silly-dinner-68354

06/03/2022, 7:42 AM
I guess something like a compound key for the user ID.
f

fresh-football-47124

06/03/2022, 7:43 AM
you can do that too
you could do a compound userId and device, and then even use regex to target
s

silly-dinner-68354

06/03/2022, 7:44 AM
I could do
${userID}-${platform}
as my key, but then I end up with duplicate users in the dashboard.
f

fresh-football-47124

06/03/2022, 7:45 AM
in LD?
s

silly-dinner-68354

06/03/2022, 7:45 AM
Yes, in LD, sorry. I'm not sure what GrowthBook's user management is like.
f

fresh-football-47124

06/03/2022, 7:46 AM
the feature flags are evaluated locally, so that level of detail as to which user saw which flag is not in our UI
s

silly-dinner-68354

06/03/2022, 7:46 AM
Hmm, so when I do
setAttributes
is that local-only data?
f

fresh-football-47124

06/03/2022, 7:47 AM
yes, there is a matching set of attributes in our UI, and it should match what is set in the SDK
the list of features, and the rules by which they are shown are pulled down to the SDK, and then the evaluation is done there
s

silly-dinner-68354

06/03/2022, 7:50 AM
When you say a matching set of attributes in the GB UI, do you mean that
setAttributes
are also synced to a server?
So if I do
setAttributes({platform: currentPlatform})
on two devices with different platforms, one after the other, then each device will have the correct platform, but whatever is synced to the server will only reflect the last write?
(Sorry if I'm being obtuse, just trying to make sure I understand this correctly.)
f

fresh-football-47124

06/03/2022, 8:33 AM
yes, that's right
well, not quiet
so the first part is correct - setting the current platform in the attributes will work as you want- on for one device/user off for another device. But there is no syncing, so 'only reflect the last one' isn't correct. What you define in the UI is the list of what attributes are available.
s

silly-dinner-68354

06/03/2022, 8:59 AM
Ah okay, I see.