Visits in different days are tracked as the same visit

I’m running a local test environment with the Nginx example Docker Compose (fpm:alpine image).

From my understanding, new visits should be recorded if a user visits the website after visit_standard_length. After a few days of testing my dashboard shows only one visit, where all the actions from multiple days are recorded.

I haven’t changed visit_standard_length, so I suppose it should be the standard 30 mins.

What could be the reason of this (unexpected) behaviour?

Hi @giovanni.allegri

Can you share the user log? (hide personal and sensitive, but let date and times visible)

Hi @heurteph-ei

This is the log (DEBUG level). Notice that:

  1. Tracker debug is turned on
  2. I have added some custom log inside VisitRequestProcessor to understand when a request was considered a new visit.
  3. A few minutes ago a request was considered a new visit (now I have 2 visits). However, even if my visit_standard_length is set to 10 (seconds), new requests are still considered as a single visit even if I refresh my website after 10 secs.

Sorry,
I am volunteer, and in the organization I am working for, I have no access to google docs for security reasons. Could you copy/paste the log screenshot directly in the message? (the forum manages this)

It’s more than 3k lines. Is there any other online option that works for you?

Can you share a screenshot of the Visits log. Visitors > Visits log
Example in demo Matomo:

I’ve created a GIST with the log: https://gist.github.com/giohappy/1fe2fd1fff860bbbec7c038ec1acb763

I don’t understand your issue. You wrote:

Here I see 4 visits (from 50 seconds to 1h17min). Everything is working well, isn’t it?

Only partially ok. If I set visit_standard_length = 10 I would expect a new visit to be recorded after 10 seconds, isn’t it? Look a the logs (custom logs are included) reported below

The first block is a page request at 15:49:56, the second one is 15:50:42.
Given the 10 secs window I expected they were considered distnict visits.

However, you will see in the second block a cutom log from me: " → Last action time: 2022-12-22 15:49:56". This datetime is calculated with $this->getLastKnownActionTime($visitProperties, $lastKnownVisit). This is used by Matomo to tell if isLastActionInTheSameVisit.

So, apparently, the previous action time is used instead of the current one, and I wonder what’s the logic behind this…

DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] Matching visitors with: visitorId=f8896b9f92fad10c OR configId=15d2cf9fc0a86845
DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] The visitor is known (idvisitor = f8896b9f92fad10c,
DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] config_id = 15d2cf9fc0a86845,
DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] last action = Thu, 22 Dec 2022 15:49:56 +0000,
DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] first action = Thu, 22 Dec 2022 15:49:56 +0000)
DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] --> Checking new visit
DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] --> Current time minus standard length: 2022-12-22 15:19:56
DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] --> Last action time: 2022-12-22 15:49:24
DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] The visit is part of an existing visit (
DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] idvisit = 6,
DEBUG CoreHome[2022-12-22 15:49:56 UTC] [60b1c] visit_goal_buyer' = 0)

DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] Matching visitors with: visitorId=f8896b9f92fad10c OR configId=15d2cf9fc0a86845
DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] The visitor is known (idvisitor = f8896b9f92fad10c,
DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] config_id = 15d2cf9fc0a86845,
DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] last action = Thu, 22 Dec 2022 15:50:42 +0000,
DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] first action = Thu, 22 Dec 2022 15:50:42 +0000)
DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] --> Checking new visit
DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] --> Current time minus standard length: 2022-12-22 15:20:42
DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] --> Last action time: 2022-12-22 15:49:56
DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] The visit is part of an existing visit (
DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] idvisit = 6,
DEBUG CoreHome[2022-12-22 15:50:42 UTC] [304b7] visit_goal_buyer' = 0)

Hi @giovanni.allegri
Sorry for my very very late response…
There is something I don’t understand. You wrote you set visit_standard_length = 10. But When I see the value of Current time minus standard length (eg. for the 2nd action of your log), I see a timeframe of 30 minutes (15:50:42 - 15:20:42 = 00:30:00). Maybe 10s is not really allowed, and is reset to 30 min?