setUserId not working (empty User IDs report)?

Hi guys. I’ve added some JS code and now my Matomo tracking code (in header) looks like this:

var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['setUserId', userId]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://Xxxxxxxxxxxxx.matomo.cloud/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src='//cdn.matomo.cloud/xxxxxxx.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
})();

The variable userId used in _paq.push(['setUserId', userId]); is definitely set when needed.

Now when I go to Matomo > Vistiors > User IDs report, it is empty.

Any ideas why? Do I need to wait for some time?
Do I need to call resetUserId for that to work?

Thanks!