Idea behind USER ID

Hi, I just started to learn Matomo. Could you please explain me idea behind “USER ID”:

Shall I decide which value I use as a User ID and set its value in this line?

_paq.push(['setUserId', 'USER_ID_HERE']);

So if I need to use User email as a USER ID then I shall take it from User Environment via JS and set the value here. Am I correct?

Hi @VictorDDT
Yes, you can.
A good practice could be also to pseudonymize user-id from tracked page (via hashing for example). Then the user ID user email won’t travel in the network, and won’t be visible in the server log. This can enhance visitors privacy.

Method for hashing (Converting a digest to a hex string):