matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.71k stars 2.62k forks source link

Server-Side handling of visit-interval, first-visit and previous-visit #7702

Closed d4rken closed 9 years ago

d4rken commented 9 years ago

http://developer.piwik.org/api-reference/tracking-api

Why does the Tracker not autonomously fill in "_idvc" (visit count), "_viewts" (previous visit) and "_idts" (first visit)?

The Tracker should have everything necessary to set these values as long as he can uniquely identify the user.

Was this a performance/scalability decision? Or was the idea to allow tracking of these values if the Tracker could not uniquely identify the user?

Also see https://github.com/piwik/piwik-sdk-android/issues/18

mattab commented 9 years ago

Hi @d4rken

In the Javascript client, _idvc, _viewts and _idts are stored in the first party cookie in the visitor browser.

Piwik has the data internally to process the values for those attributes, but technically Piwik cannot process those values in a performance efficient manner (You guessed right that it was performance/scalability reason). To process the values Piwik would need to look back in time for the visits by this visitor and look when was the first visit, how many visits there were, etc. this would be too slow and not scale. for performance reasons we expect the parameters to be set by Tracking API clients (when they can do so)

Hope it helps

d4rken commented 9 years ago

If anyone stumbles across this issue, #4750 is interesting too.