profile
viewpoint

Ask questionsFiltered monthly page views do not sum up to filtered yearly page views

When requesting data from the page url table and filtering it regarding a specific url, the data returned for requests for each month of a year independantly does not sum up to the data returned for a request regarding the whole year. This holds true both for using the webinterface as well as using the API.

Expected Behavior

Values of a metric for all months of a year should sum up to value of the same metric for the whole year.

Current Behavior

Sum of monthly values does not match yearly value (in my case: exceeds it).

Steps to Reproduce (for Bugs)

Example

  1. Get https://demo.matomo.cloud/?module=API&token_auth=anonymous&filter_limit=-1&method=Actions.getPageUrls&format=csv&flat=1&showColumns=nb_visits%2Cnb_hits&filter_pattern=%2Fdiving&convertToUnicode=0&idSite=1&period=year&date=lastYear
  2. Same request for each month of that year (12x), period=month:
    1. date=2020-01-01
    2. date=2020-02-01
    3. ...
  3. Compare returned data for the whole year with summed returned monthly data:
    1. Sum all values of columns nb_visits and nb_hits for every returned data table
    2. Sum the respective sums of all monthly data tables
    3. Compare values for whole year with calculated sum for all months

In the given (and randomly chosen) example the values are:

Metric Year Sum Month Difference
nb_visits 1.672.155 1.672.216 61
nb_hits 2.032.618 2.032.691 73

I admit the diifferences are quite low here, but there honestly shouldn't be any at all. Furthermore for our own data it looks like this which is really non-neglectable:

Metric Year Sum Month Difference
nb_visits 38.728 41.385 2.657
nb_hits 54.366 58.026 3.660

Context

We need total (unique) pageviews for a certain subset of urls. Usually we report them on a yearly bases but we now needed them for every month of a year and realized that the monthly values do not add up to the respective yearly value.

Your Environment

<!-- Include as many relevant details about the environment you experienced the bug in --> <!-- You can find some of that information in the system check -->

  • Matomo Version: 4.2.1
  • PHP Version: 7.3
  • Server Operating System: ubuntu18.04.1
  • Additionally installed plugins: HeatmapSessionRecording (v4.0.11)
matomo-org/matomo

Answer questions tsteur

@heurteph-ei there should be already a feature request for this 👍

useful!
source:https://uonfu.com/
Github User Rank List