CleverTap / clevertap-android-sdk

CleverTap Android SDK
MIT License
80 stars 74 forks source link

Multiple profiles merging into one #552

Closed samarthgupta2907 closed 4 months ago

samarthgupta2907 commented 9 months ago

Despite creating two unique identities, I can see the profiles are getting merged into one. I am calling the OnUserLogin API on the new identity, but on the clevertap dashboard, I can see these identities getting merged.

Expected behavior As per the documentation - On calling the OnUserLogin API, two different profiles should have been created.

Screenshots/Logs Adding logs and screenshots of the issue -

onUserLogin: {Name=Samarth, Identity=41787103_90228_MANAGER, Email=samarthgupta29@gmail.com, Phone=7073804522, Res ID=90228, City ID=6, Device
                 ID=0d9e8927-feb1-4c38-b4b8-18b2844cf876, Permission=MANAGER, POS=true, Hyperpure=true, User ID=41787103} maps to current device id __7aad0143d0614cee9d80dd3a77604a4b pushing on current
                 profile
onUserLogin: {Name=Samarth, Identity=41787103_50002_MANAGER, Email=samarthgupta29@gmail.com, Phone=7073804522, Res ID=50002, City ID=4, Device
                 ID=0d9e8927-feb1-4c38-b4b8-18b2844cf876, Permission=MANAGER, POS=false, Hyperpure=true, User ID=41787103} maps to current device id __7aad0143d0614cee9d80dd3a77604a4b pushing on current
                 profile
Screenshot 2024-02-15 at 4 54 36 PM
darshanclevertap commented 9 months ago

@samarthgupta2907 Identity and Email are composite keys for the CleverTap SDK. If you provide the same email ID or identity then the profiles will be merged. Please check issue #113 particularly this comment for more info or raise a support ticket via our Help Center

samarthgupta2907 commented 9 months ago

Thanks for the quick revert Darshan. Thanks for clarifying this.

samarthgupta2907 commented 9 months ago

Hi @darshanclevertap - Before we close this. Can you help address this - https://github.com/CleverTap/clevertap-android-sdk/issues/113#issuecomment-1945976037

Would like to know if we have to handle this case in a specific way, or something else ? Since, currently our profiles with unique identifiers are getting merged into one because emails are same.

rd7773 commented 9 months ago

@darshanclevertap We want to keep the identifier as 'Identity' key only and not email or FBID. When checked on our CT console, only 'Identity' was selected but when debugged on the client side in the ConfigurableIdentityRepo class, the loaded identityset was having values as [Email, Identity] which seems to be picked from default legacy values which might be due to failed fetching from CT backend. My question is, is it enough to set the identifier on the console or do we need to set in the android manifest as well? Also, apart from pushing profiles from the app using onUserLogin, we do import them via SMTP using the same column names 'Identity', 'Email' amongst others. It would be helpful if you can guide us through this as docs and behaviour seems contradictory.

darshanclevertap commented 9 months ago

@rd7773 @samarthgupta2907 For both of you - the answer is that we need to do some code changes in the AndroidManifest file so that only "Identity" is treated as the primary key. To help you with the correct code for both of your cases, please reach out to our support teams via the Help Center and mention this GitHub issue and we will provide you with the steps to solve for your cases.

Anush-Shand commented 4 months ago

Closing this issue due to inactivity. Feel free to reopen for further assistance