Statistics views today count is wrong

Created on 5 June 2024, 8 months ago
Updated 1 July 2024, 7 months ago

The statistics module "Views today" count is wrong, it seems to be the same as the "Total views".

I'm using Drupal v9.5.1.

I enabled the core statistics module and have it running for a couple of days.
After a couple of days I notice in the view I created on the statistics data that the "Views today" and "Total views" are always the same, even when I check 3 days e.g. in the past.

Also, as Cilefen said, Drupal 9.5 is unsupported and the contrib version won't work on it, as it requires Drupal 10.3 at least. But it would have the same behaviour: that is by design.

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component
Statistics 

Last updated 17 days ago

No maintainer
Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sboden
  • Drupal 9 is unsupported. Statistics is deprecated in Drupal 10 and removed in Drupal 11. I am moving this to the contributed module, where bugs could be fixed.

  • 🇫🇷France fgm Paris, France

    This can happen if there is no view on a given node on a given day: the view count will remain unchanged. The "views today" value is actually "views on the day of the last view".

    On content with enough traffic this ends up being the same because all content is seen at least once a day. To get a more accurate result you will need to add a filter ensuring that the day of the last timestamp is the same as the current day, and return 0 otherwise.

    Can you check viewing the node you are interested in and then verifying that the daily count was indeed reset ?

  • The daily and total count for me are always the same, so the daily count doesn't reset.

  • 🇫🇷France fgm Paris, France

    As I mentioned, if you do not actually view a node during a given day, the daily counter does not reset. It is actually the count of views on the last day there actually was a view.

    Does it not reset if you actually view the node another day ? If so, can you provide a means to reproduce the issue, because this is not what I observe on my own sites.

  • I'm going to close this one. I figured out what's going on.

    There's a cronjob that resets the daily stats, my app runs in AWS Fargate and its cronjob triggering process apparently broke.

  • Status changed to Closed: works as designed 7 months ago
  • 🇫🇷France fgm Paris, France

    Excellent: thanks for taking the time to let me know.

Production build 0.71.5 2024