Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymous Identities #168

Open
dabeeeenster opened this issue Jul 7, 2021 · 17 comments
Open

Anonymous Identities #168

dabeeeenster opened this issue Jul 7, 2021 · 17 comments
Assignees
Labels
api Issue related to the REST API feature New feature or request sdk Issues related to the SDKs

Comments

@dabeeeenster
Copy link
Contributor

dabeeeenster commented Jul 7, 2021

Anonymous Identity handling improvements:

  1. 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.
  2. If an anonymous user then authenticates, the SDK would call the merge method.
  3. Create a new anonymous_id property that the identify endpoint can accept
  4. It stores the old ID in a new field anonymous_id and 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

@dabeeeenster dabeeeenster added feature New feature or request api Issue related to the REST API sdk Issues related to the SDKs labels Jul 7, 2021
@dabeeeenster
Copy link
Contributor Author

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")));

@dabeeeenster
Copy link
Contributor Author

We also need to consider how this is handled with the Analytics integrations.

@kyle-ssg
Copy link
Member

kyle-ssg commented Apr 10, 2022

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

@kyle-ssg kyle-ssg removed their assignment Apr 10, 2022
@jbtheard
Copy link

jbtheard commented Feb 9, 2023

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.

@dabeeeenster
Copy link
Contributor Author

We do want to get to this - most likely Q2 2023.

@dabeeeenster
Copy link
Contributor Author

dabeeeenster commented Mar 1, 2023

OK so current thinking is:

  • SDKs can use the existing endpoints, but can optionally pass an identity_seed value 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 that identity_seed on the device.
  • SDKs have a new method defined, alias that 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) and getIdentityFlags(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?

@AChevallier
Copy link

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.

@taltcher
Copy link

taltcher commented Jun 20, 2023

@dabeeeenster do you have an estimation of when this feature will be available?

@dabeeeenster
Copy link
Contributor Author

dabeeeenster commented Jun 20, 2023

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.

@dabeeeenster dabeeeenster moved this from Planned Q4 2023 to In Progress Q3 2023 in Flagsmith Roadmap Jul 10, 2023
@dabeeeenster dabeeeenster moved this from In Progress Q3 2023 to Planned Q3 2023 in Flagsmith Roadmap Jul 10, 2023
@Skwai
Copy link

Skwai commented Aug 11, 2023

Still no progress on this? Still doesn't seem to be a way to use anonymous_ids

@jbtheard
Copy link

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.

@dabeeeenster
Copy link
Contributor Author

We are about to start work on this - thanks for hanging in there people!

@taltcher
Copy link

@dabeeeenster - any update regarding this?

@dabeeeenster
Copy link
Contributor Author

It has slipped! We are planning on building this the current quarter.

@taltcher
Copy link

@dabeeeenster - any update regarding this?

@matthewelwell
Copy link
Contributor

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.

@dabeeeenster dabeeeenster moved this from Planned Q1 2024 to Planned Q2 2024 in Flagsmith Roadmap Mar 12, 2024
@dabeeeenster dabeeeenster moved this from Planned Q2 2024 to In Progress in Flagsmith Roadmap May 15, 2024
@matthewelwell
Copy link
Contributor

This is on hold while we work on #4278 which will implement a lot of the necessary functionality needed for anonymous identities.

@matthewelwell matthewelwell moved this from In Progress to Planned 2024 in Flagsmith Roadmap Jul 8, 2024
@dabeeeenster dabeeeenster moved this from Planned 2024 to Planned Q3 2024 in Flagsmith Roadmap Jul 12, 2024
@matthewelwell matthewelwell moved this from Planned Q1 2025 to Planned 2024 in Flagsmith Roadmap Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request sdk Issues related to the SDKs
Projects
None yet
Development

No branches or pull requests

9 participants