-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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] Filtering by 'Visit converted specific goal name' using CONTAINS is Incorrect #22816
Comments
Hi, At first, we suspected this was simply because we were misinformed about what such a filter is supposed to do, i.e. rather than showing only goal rows that match the filter, it would show goals that were achieved by visitors that matched the behaviour of the filter. In this case, all goals triggered by visitors that achieved the 'foo' goal, as is the case in the situation pertaining to this issue. However, not all goals we would expect to result from that visitor-based logic showed up on the report, so this seemed like a different case. Hence, we delved into the SQL resulting from the report definition. Suspected causeThe MySQL statement tied to a report with this filter showed the following :
where the most important section is the log_inner-subquery:
And in particular
The user has multiple sites, with their own goals. It seems idgoal is reused across sites in the tables, making the join above not specific enough. While the goalname filter is applied to the rows in the table aliased as 'goal_segment_log_conversionidgoal ', the join clause - not containing idsite - returns a join set where the id of a goal that matches 'foo' in a different site, is matched against a goal with the same id on site 15. For clarification, see the table below, which serves as an example for how these goal records are present in matomo_log_conversion as well as in matomo_goal: The intention of the user is to get foo 1 and foo 2 (since those match idsite 15 and the 'foo' like match). However, they got foo 1, foo 2 and bar 1. I have confirmed that manually adding a filter for goal_segment_log_conversionidgoal on idsite on the join clause or in the where clause does return the expected result set. |
What happened?
When applying a filter for the dimension Visit converted specific goal name with the condition CONTAINS (e.g., "foo"), the results are expected to include only goals containing the specified keyword. However, the filter also incorrectly includes unrelated goals (e.g., "bar").
The issue is reproducible in both Custom Reports and Segments.
The customer mentioned instances where goals with the same goal ID from another website were included, but I could not reproduce this aspect.
What should happen?
The filter should only return goals containing "foo" (foo1 and foo2).
How can this be reproduced?
Matomo version
5.1.2
PHP version
8.2.19
Server operating system
No response
What browsers are you seeing the problem on?
No response
Computer operating system
No response
Relevant log output
No response
Validations
The text was updated successfully, but these errors were encountered: