Track visits on profile page

I have a community where users can create a own profile. Now i want to use piwik to save visits on the users profile page. What is the best way to do this?
I want to create a new website in piwik when a new account is created, is this possible through the API or how can i do this?

Then on the profile page, i only add:
_paq.push([‘setSiteId’, X]);
_paq.push([‘setCookiePath’, ‘/user/MyUsername’]);
_paq.push([‘setDomains’, ‘’]);
Is that correct?

Yes, you would do something like this. See also this page which is a bit similar use case (although with log analytics) Log Analytics: a Business Use Case - Analytics Platform - Matomo