flagsmith
flagsmith copied to clipboard
Anonymous Identities
Anonymous Identity handling improvements:
- Add a way of signalling that an identity is "Anonymous" within all the SDKS when identifying a user. Anonymous identities prevent a record from being stored in the Flagsmith database, but provides the data to bucket the user in segments/mv flags etc.
- If an anonymous user then authenticates, the SDK would call the
mergemethod. - Create a new
anonymous_idproperty that theidentifyendpoint can accept - It stores the old ID in a new field
anonymous_idand makes the new ID the primary Identity ID so that administrators can search on the primary ID.
If present, the field anonymous_id is always used when calculating segment buckets/MV flags etc. This is to prevent a user moving between buckets before/after a merge.
What to do if we are asked to merge an Identity that already exists?
We overwrite the new anonymous_id with the existing anonymous_id
We need to figure out the best design for the SDK interface. For example, the Java SDK has:
FeatureUser user = new FeatureUser();
user.setIdentifier(identifier);
FlagsAndTraits flagsAndTraits = flagsmithClient.identifyUserWithTraits(FeatureUser user, Arrays.asList(
trait(null, "trait1", "some value1"),
trait(null, "trait2", "some value2")));
For anonymous identities, suggest:
FeatureUser user = new FeatureUser();
user.setAnonymousIdentifier(identifier);
FlagsAndTraits flagsAndTraits = flagsmithClient.identifyUserWithTraits(FeatureUser user, Arrays.asList(
trait(null, "trait1", "some value1"),
trait(null, "trait2", "some value2")));
We also need to consider how this is handled with the Analytics integrations.
I can't do much on this my side, it might be worth assigning an issue to the JS SDK / for the admin panel when we add a filter. I think also it might be worth considering making this a trait rather than a new field so that users can segment on anon users
This, to me, is a must have feature as more and more UX will push for a deferred account creation; ie wait until (anonymous) user has experienced enough value before asking him to convert into a logged user. It surely is a trend and we want to start A/B testing way before user has created an account.
We do want to get to this - most likely Q2 2023.
OK so current thinking is:
- SDKs can use the existing endpoints, but can optionally pass an
identity_seedvalue that is used for the flagsmith engine to compute MV values/splits. This would be used for anonymous browser/user etc so they have a consistent experience. The SDK would be required to store thatidentity_seedon the device. - SDKs have a new method defined,
aliasthat takes a generated GUID and the user's actual identifier once they have logged in. The API would store the anonymous seed GUID alongside the Identity for future MV/split calcuations.
Questions
- What happens if an SDK calls getIdentityFlags with a seed as an Identity?
- Do we prevent any seeds being stored as identities?
- Does
getIdentityFlags(seed)andgetIdentityFlags(identifier)do the same thing if there is the identifier and seed data in the DB? - We don't need to store the seed if there are no traits, but if there are traits, do we assume they are transient and on the client?
It looks very nice. I am using "Segment aliasing" with Mixpanel and the system is working very well. https://segment.com/docs/connections/spec/alias/
@dabeeeenster
Maybe a Identity should have 2 ids (primary key), one seed_id and one user_id which should be null if no identify(), like Segment.
We can imagine an app with half of the application does not required to be logged in. So it would be important to store the traits of a seed.
@dabeeeenster do you have an estimation of when this feature will be available?
Not currently. We'd like to get it complete next quarter but we still have a backlog of Enterprise features we are working through, sorry.
Still no progress on this? Still doesn't seem to be a way to use anonymous_ids
Seriously considering moving away from Flagsmith for this very reason. Too bad this long awaited request hasn't been prioritized so far. Very useful for consumer focused businesses.
We are about to start work on this - thanks for hanging in there people!
@dabeeeenster - any update regarding this?
It has slipped! We are planning on building this the current quarter.
@dabeeeenster - any update regarding this?
Hi @taltcher, we are progressing this but it's still in progress I'm afraid, we have had other priorities for our enterprise product this year. We have updated the content of the discussion here which details our proposed implementation of identity contexts, and anonymous identities. If you have any additional feedback on the proposal, we'd love to hear it.
We are hoping to make more progress on the development early next year and will of course keep you updated on this issue.