matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.87k stars 2.65k forks source link

"Page URL Does not contain" segment condition has excluded Page URL in reports #19672

Open Starker3 opened 2 years ago

Starker3 commented 2 years ago

It looks as though the "Page URL does not contain" segment condition still allows some Page URLs to be included in the Pages report.

If we take an example of this segment: image

And then process the reports, we still get some Page URLs in the report that contain this exact string: image

However, the segmented visits log doesn't show any actual data for this: image

When searching the actual visits log there are no visits that include this string: image

NathanDB99 commented 2 years ago

I have brought this issue to the attention of Matomo and they were able to replicate is, as seen above. In my case the /index of pages we want to exclude are still shown in the pages report. Indeed the /index of this pages are not shown in the visitor logs.

sgiehl commented 2 years ago

I think that is kind of expected behavior as segments in Matomo work that way. A segment is always used to filter the list of visits that are included in a segment. So when using a segment like page url does not contain Matomo will select all visits that have a page view with a url that does not contain something. It will not exclude a visit if there is an action that contains the defined url (if there are also other actions). Afterwards when generating the reports the excluded url will so be contained in the reports again, as it is part of a visit that is included in the segment.

Starker3 commented 2 years ago

@sgiehl But in that case would we not expect to see that in the Visits Log when viewing the segment?

heurteph-ei commented 2 years ago

Isn't is the same as: https://github.com/matomo-org/matomo/issues/17388

sgiehl commented 2 years ago

@Starker3 you will also see that in the visits log. What you wouldn't see there is a visit that only has an action with the excluded url. But as soon as visit also has other actions it will be shown.

tsteur commented 2 years ago

FYI And it likely refs https://github.com/matomo-org/matomo/issues/14664

Starker3 commented 2 years ago

Thanks for the additional info @sgiehl When I check the Visits log for All Visits we can indeed see some visits that contain other actions: image

However, if I apply the segment from the screenshot above (That excludes any Page URL with /selection), then there are no visits shown that include this Page URL in all ~900 visits in the segment: image image

9joshua commented 2 months ago

A customer has a related issued with segment filters where multiple "Does not contain" filters are used.

If only one filter is used (e.g. Page URL Does not Contain '888'), any visit with at least one action matching that condition causes the entire visit to be excluded, as expected... image

However, when multiple "Does not Contain" conditions are joined by an OR operator, the visits where BOTH conditions are contained in the SAME URL are excluded... image image The only excluded URL above was localhost/?888&999

Expected behaviour: When excluding a URL via "Does not Contain" one would expect the filter to omit the entire visit where the condition is matched. Similar to how a "Contains" condition would include the entire visit where the condition is met. So a visit that included both of the defined URLs should be excluded.

Actual behaviour (with multiple "Does Not Contain" conditions are joined with OR): IF:

This makes it impossible to filter a report for visits where a visitor did not visit two specific URLs that match the "Does not Contain" conditions.