Reading the userid on the browser

I would like to know how I can retrieve and use the userid on the browser?

Hey Viktorija,
To do so you can use the following code
window.Matomo.getAsyncTrackers()[0].getUserId()