Web analytics - Identification of users

Hello,

I am currently trying the free demo of 30 days of the Enterprise Edition and I'd like to test the User Profile feature.
I integrated the Javascript SDK in my web application and I would like to identify, with Countly, the users who log in my app.

So, basically, I have this piece of code at the place where I check that the couple username/password entered is correct:

Countly.q.push(['user_details',{
    "name": fullname,
    "username": username,
    "email": email
}

I see now in the User Profile feature a row with the right username, the right full name and the right email.
The problem is when I am trying to log in with a different browser or with the incognito mode. It seems that Countly does not understand that the user is the same, it duplicates the row and gives a different ID and UID.

Do you know what I could do to solve this and that Countly never duplicates rows when it sees that there is already a row with this username ?

Thanks

Hello
you could, for example, use username as user identifier.
And once user logs in, you could call

Countly.q.push(['change_id', username, true]);

That would make identifying all users under same username as one user

I think I missed this function in the documentation :+1:

Thank you !

Hi,

I'm not creating a new topic this time because I think it's still pretty related to the previous issue.
So, as you adviced me, when a user logs in, I call those 2 functions:

Countly.q.push(['user_details',{
    "name": fullname,
    "username": username,
    "email": email
}
Countly.q.push(['change_id', username, true]);

So, when someone's using a different browser or the incognito mode, Countly will recognize the user anyway and there will be only one raw in User Profiles.

In our use case, there’s one instance of the web app for each organization using the product, each with it’s own set of independent users. Potentially having username duplications between instances (e.g. each instance has an admin). When it is the case, I would like to have two raws in User Profiles even if the two accounts have the same username.

Countly.q.push(['user_details',{
    "name": fullname,
    "username": username,
    "email": email,
    "organization": company
}
Countly.q.push(['change_id', username, true]);

With this piece of code, Countly will just change the value of organization attribute with the last one that it received.
Do you know if there is an easy way to solve this issue ? I thought of calling change_id with username+company instead of just username but this solution is not really convincing me.

Thank you.

Hello, then you need to find an identifier that identifies your user the way you want.
Maybe username+instance name?