@diosmosis opened this Issue on February 13th 2019 Member

Saving days means cutting off the time of day, which makes the information less accurate. This prevents using, eg, visitor_days_since_first to find the exact time of a visitor's first visit.

Changing this would mean updating every row in the log table so we should likely do it in Matomo 4.

When changing this we can also get rid of the _idts query parameter in the tracker. It is possible to compute this in PHP without ever having to issue a SQL query.

After we search for an existing visitor we would:

  1. if new visitor, set time_since_last_visit = 0
  2. if existing visitor, set time_since_last_visit = last_visit.time_since_first_visit + (this_visit.visit_first_action_time - last_visit.visit_last_action_time)

This would allow computing this value for every type of tracking.

Refs #14125

@diosmosis commented on November 15th 2019 Member

This will also require a change to cohorts.

@mattab commented on February 20th 2020 Member

@diosmosis

Is this needed/valuable for Cohorts only, or are there more benefits to changing the field?

Changing this would mean updating every row in the log table so we should likely do it in Matomo

Probably we could skip the "update every row" and leave the old data as-is, and only insert the new data with the more accurate info.

@diosmosis commented on February 21st 2020 Member

Is this needed/valuable for Cohorts only, or are there more benefits to changing the field?

@mattab It allows Cohorts to be used w/ log analytics, server side analytics, makes the dimension more accurate (no bad values being sent), allows days since last dimension to be available w/ log analytics, and requires less data stored client side in a cookie.

Probably we could skip the "update every row" and leave the old data as-is, and only insert the new data with the more accurate info.

This is referencing having second durations instead of days so the setting is more accurate and doesn't result in slightly inaccurate reports in cohorts.

This Issue was closed on June 26th 2020
Powered by GitHub Issue Mirror