Set Visitor ID in piwik

Hi,

I am new to piwik. I have a contact us form in my website. When a user fills in the details and submits the form a new lead is getting generated in sugarCRM via REST call which returns back a unique id of the user. Is there a way where I can set this unique id in piwik to track the returning visits and other details?I need to implement this using REST call to piwik, so I looked into the tracking api reference.

POST
http:///piwik.php?idsite=1&rec=1&url=http://www.vistrit.com/about-us&uid=&token_auth=

Am I doing anything wrong?The visitorID is not getting set and nothing is reflected in the visitor section.

Also can I use the visitor Id for later use like calling this methods Live.getVisitorProfile (idSite, visitorId = ‘’)?

Any help will be truly appreciated.

Hello, you were almost there! Please use the User ID feature: User ID - Analytics Platform - Matomo (instead of the old now deprecated visitor id)

User ID is available in Javascript API via setUserId()