Hello,
after the installation of the module we noticed a problem related to the counting of the visit.
When you are not logged in to the site (anonymous user) and visit a page displayed on the frontend, the visit is not counted - registered on database.
Instead, when the visit is made by a logged user, such as administrator, the visit is counted correctly.
We have also seen that by deactivating the page cache (in settings.php file, by adding the following entry: $settings['cache']['bins']['page'] = 'cache.backend.null') the visit made by anonymous user is counted correctly.
Is it possible to keep the visit counting for anonymous users without deactivating the page cache?

Here are the configurations related to the server in use:
- Drupal version: 9.4.3
- Cache / CDN: none

Issue fork visitors-3307257

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

claudioder86 created an issue. See original summary.

bluegeek9’s picture

Title: Anonymous user visits not counted » Log visits with ajax
Version: 8.x-2.11 » 8.x-2.x-dev
Category: Support request » Feature request

Visitors log the visit during hook_exit() so currently, there is no way to log cached (anonymous) views.

I looked at what the core statistics module does. It attaches javascript which makes an ajax request to drupal. This is how Matomo/Piwik, and Google Analytics work too.

This is the direction I want to take Visitors. Using javascript grants access to more data/metrics, e.g. screen resolution and browser features.

I have changed the issue to a feature request. There are a few smaller issues I want to resolve before starting on this.

claudioder86’s picture

Thanks for your support.
when will this new feature be available?

bluegeek9’s picture

Version: 8.x-2.x-dev » 7.x-1.x-dev
Priority: Normal » Critical
Related issues: +#1087268: Exclude robots from the statistics

I will start it next for 7.x-1.x.
Before I can start, I need to wrap up #3087315: Filter/filter config anonymous users & paths for 8.x-2.x.

This feature also helps mitigate #1087268: Exclude robots from the statistics

bluegeek9’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev
Assigned: Unassigned » bluegeek9

  • bluegeek9 committed bdb29709 on 8.x-2.x
    Issue #3307257 by bluegeek9: Log visits with ajax
    
bluegeek9’s picture

Assigned: bluegeek9 » Unassigned
Status: Active » Fixed

  • bluegeek9 authored f2d903c6 on 8.x-2.x
    Issue #3307257 by bluegeek9: Log visits with ajax
    

  • bluegeek9 authored 389c4bbd on 8.x-2.x
    Issue #3307257 by bluegeek9: Log visits with ajax
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.