Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Segmenting for "Number of Visits" returns non-matching visits #22176

Open
4 tasks done
9joshua opened this issue Apr 30, 2024 · 1 comment
Open
4 tasks done

[Bug] Segmenting for "Number of Visits" returns non-matching visits #22176

9joshua opened this issue Apr 30, 2024 · 1 comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Data Integrity & Accuracy c: Segments Segmentation and Segment editor related improvements and fixes.

Comments

@9joshua
Copy link
Contributor

9joshua commented Apr 30, 2024

What happened?

Segmentation reports for Number of Visits = 1 include visitors with more than one visit. Here the number of Unique Visitors and Visits metrics should be equivalent...
Screenshot from 2024-05-01 08-23-44

Searching the Visits Log shows some visitors who had 2 visits...
Screenshot from 2024-05-01 08-23-07

This issue also appears to affect Custom Reports which would be expected as the RAW data (as shown in the Visits Log) does not properly apply the number of visits condition.

What should happen?

Segmenting reports where the number of visits =1 should omit all visitors with more than 1 visit.

How can this be reproduced?

  1. Create a Segment where "Number of Visits = 1"
  2. View the visit log to find visitors with more than one visit
  3. Observe the discrepancy between Visits and Unique Visitors - these metrics should be identical

Matomo version

5.0.3

PHP version

8.1

Server operating system

Linux

What browsers are you seeing the problem on?

Chrome

Computer operating system

Ubuntu

Relevant log output

No response

Validations

@9joshua 9joshua added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Apr 30, 2024
@sgiehl
Copy link
Member

sgiehl commented May 2, 2024

Looking at the code this can be easily explained. We storing a visit counter with the visits. So if a visitor has three visits, the first visit has stored a 1, the second a 2, ...
The segment currently directly selects by this column. So if you are looking for equals 1, it will select the first visit of all visitors.
So this segment is kind of broken by design. It might return correct data when looking for e.g. greater than, but everything else might always include other visitors.

@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. c: Data Integrity & Accuracy c: Segments Segmentation and Segment editor related improvements and fixes. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels May 2, 2024
@sgiehl sgiehl added this to the For Prioritization milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Data Integrity & Accuracy c: Segments Segmentation and Segment editor related improvements and fixes.
Projects
None yet
Development

No branches or pull requests

2 participants