Usually when a new user first visits our site they don't have an identifier at all. When they have registered we can use their data for qiscus sdk.
For cases like this the steps we have to do are as follows:
1. Initiate Qiscus SDK
2. For anonymous users we will generate random users for them. We can use the following code `unique_id = '_' + Math.random (). ToString (36). Substr (2, 9);`
3. When the user is logged in, use unique_id of your choice from the user's login data.
For a working example, you can refer to this codesandbox: