By default, Piwik will use the IP address to decide Unique Visitors. If you are using the Tracking API, or in some cases when you may prefer not to use the IP address to decide Unique Visitors, but instead you may set a Visitor ID manually. You can ask Piwik to not rely on the IP address as a mean to differentiate one user from another.

To track unique Visitors based on the Visitor ID (found in the cookies or the Tracking API), edit your config/config.ini.php and add below

[Tracker]

the following:

[Tracker]
trust_visitors_cookies = 1