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

Duplicate Profiles creation #113

Closed
Aryan210 opened this issue Oct 15, 2020 · 17 comments
Closed

Duplicate Profiles creation #113

Aryan210 opened this issue Oct 15, 2020 · 17 comments

Comments

@Aryan210
Copy link

While using Clevertap's pushProfile function, it is creating multiple profiles if I change details associated with it. Is there a way that we can update the existing profiles with new values instead of creating a new profile?

@darshanclevertap
Copy link
Collaborator

@Aryan210 Can you show us the code you're using to update the profile?

@Aryan210
Copy link
Author

mCleverTap = CleverTapAPI.getDefaultInstance(context);
CleverTapAPI.setDebugLevel(CleverTapAPI.LogLevel.DEBUG);
HashMap<String, Object> data = new HashMap<>();

		data.put("deviceIdImei", mDeviceId);
		Log.i(TAG, "clever tap check : Identity = " + data.get("Identity"));
		data.put(MixPanelColumns.FLOW_VERSION, flowVersion);
		if(isEmptyOrNull(userId)){
			mCleverTap.profile.push(data);
		}

@darshanclevertap
Copy link
Collaborator

@Aryan210 Sorry, can you also tell us which version of the CleverTap SDK are you using currently?

@Aryan210
Copy link
Author

com.clevertap.android:clevertap-android-sdk:3.5.1

@darshanclevertap
Copy link
Collaborator

@Aryan210 v3.5.1 is a very old SDK version. We've fixed a bunch of bugs and issues since then. I'd suggest you move to CleverTap Android SDK v4.0.0 soon or as per this Google Policy you won't be able to push updates to your app starting November 2nd. And since you'll be moving from a very old SDK version, I'd suggest that you please go through our Android integration documentation once again.
Let us know if you continue facing this issue once you've moved to the latest version.

@Aryan210
Copy link
Author

Aryan210 commented Oct 15, 2020

Anyways that is something the team is working on. My doubt is still the same that if we change certain params (not the phone number/email), then Clevertap will create new profile on calling the push function? If yes how can we only update the profile and not create another instance of the profile.

@darshanclevertap
Copy link
Collaborator

@Aryan210 No, profile.push(now deprecated) and pushProfile (new) method do not create a new profile. Can you check if you're unknowingly calling onUserLogin with a new identity or email before calling profile.push

@Aryan210
Copy link
Author

Aryan210 commented Oct 15, 2020

@darshanclevertap Can I assume onUserLogin also doesn't creates new profile every time? Nothing clearly mentioned on the documentation

@darshanclevertap
Copy link
Collaborator

@Aryan210 onUserLogin method does create new profiles if you pass a new identity/email to it. pushProfile does not. Please go through our documentation on handling a single user here and multiple users here.

@Aryan210
Copy link
Author

@darshanclevertap Can you clarify these two scenarios. In both the cases the identity we are passing are same for onUserLogin

  1. No email was previously there, this time we including email in the data. Will it create new profile?
  2. Previously there was a different email, now I updated the email with the same identity. Will it create new profile?

@piyush-kukadiya
Copy link
Contributor

@Aryan210 If you pass same identity then it won't create new profile in both cases.

@Aryan210
Copy link
Author

@piyush-kukadiya On the documentation it says -

"If instead you wish to assign multiple Identity, Email, or FBID values to the same user profile, push that profile information on the current user profile (via profile.push/profilePush) rather than onUserLogin."

So I suppose if email id and Identity are being passed, same id but different email, then it would create a different profile on Clevertap. Can you clarify this?

@piyush-kukadiya
Copy link
Contributor

@Aryan210 We have to consider 4 identifier here Identity, email, FBID and GPID.

With profilePush() All of them gets merged into single Profile.
With onUserLogin() out of 4, if you pass any identifier which is same as the one that you pass earlier, then that will get merged with profile.
For example,

  1. On first App launch you wont pass anything, so anonymous profile gets created, let's say Profile1
  2. Then you pass ID1, so ID1 will get merged with anonymous profile(Profile1).
  3. Then you pass ID2, so new profile will get created let's say Profile2
  4. Then you pass Email1 + ID2, so Email1 will get merged with profile containing ID2(Profile2).
  5. Then you pass Email2 + ID2, so Email2 will get merged with profile containing ID2(Profile2).

Attaching an image for better understanding.
clevertap_profile

@darshanclevertap
Copy link
Collaborator

@Aryan210 Does this help in solving your issue?

@rd7773
Copy link

rd7773 commented Feb 14, 2024

@darshanclevertap @piyush-kukadiya Can't 2 profiles have same email? We want to have multiple profiles for the same user hence the email would be same but the identity will be different. This is what we are trying to do by using onUserLogin with a unique identityID with each profile switch but it's merging the profiles basis on email even when identityID are different.

@darshanclevertap
Copy link
Collaborator

@rd7773 It is possible but requires certain code customizations. Since this issue is already marked as completed, I would request you to raise a support ticket with our team via our Help Center and they will promptly help you out.

@rd7773
Copy link

rd7773 commented Feb 15, 2024

@darshanclevertap I understand i need to create a separate ticket for this but just to be clear, the code customisations would be required at the client end or in the clevertap's client sdk or clevertap's backend end?
Also in this comment you shared if we send same email in the onUserLogin it will merge the profiles so it's becoming a bit confusing that exactly would be required to have 2 separate profiles with unique Identity but same Email?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants