Visitors not tracking properly in Piwik 2.16.1

Hello All,

Is there something that I am missing to track unique, repeat and returning visitors correctly?

I am using the following trackers for my site to track any visit or visitors.
setDocumentTitle
setCookieDomain
setDomains
setUserId
trackPageView
enableLinkTracking

Following columns from piwik_log_visit:
visitor_days_since_last, visitor_returning and visitor_days_since_first are all showing value '0’
and visitor_count_visits showing value ‘1’.

P.S: have tried setting trust_visitors_cookies to 1 in config.ini.php.
‘idvisitor’ values are generating correctly in piwik.

-Thanks and Regards,
Aneesha Rao A.

These values should be tracked correctly as long as your visitors have first party cookie enabled.

Enabled to allow first party cookies… Still no changes in the values… What else am I missing?

-Thanks and Regards,
Aneesha Rao A.

Are the cookies created correctly on your website being tracked by Piwik? Cookie that piwik creates have a name pk_* see: What are the cookies created by Piwik JavaScript Tracking client? - Analytics Platform - Matomo

I find this id getting created in cookies for that particular network call.

-Thanks and Regards,
Aneesha Rao A.

In our installation (piwik 3.0.1), the user-activity-data from before setting userId via “setUserId” is also not merged into the user-object with known userId. Therefore, it’s will not be seen when looking at the user with Id set.