New Visit in Segmentation not working fine

When trying to log in as the new user with the new user id(we are sending the user id to matomo) it is not getting reflected in the segmentation with the visit type new it is shown in visitor type returning. But when checking the profile of the user has only 1 visit.

Did you check this:

yes . Based on this on we have set the user id and tried .but still sometimes the user with the new user id is getting tracked in returning user

@Kalpana_Balasubraman Can you share the piece of code where you are setting userID and screen shot for segmentation which is not working?

Please find the code to set the user id:
Var userID=“testUser1”


_paq.push([‘setUserId’, userID]);

Hi @Kalpana_Balasubraman Segmentation looking correct, the way to set user id is also fine and I hope you are setting user ID before _paq.push(['trackPageView']);

So, it is possible that there is a returning visitor and you set the user ID for that visitor, and assuming to see that visitor as a new visitor, so a visitor with a unique userID can also be a returning visitor.