We are using the Custom Reports plugin to define reports over some of our Custom Dimensions. The Custom Dimensions can have values like:
<1 - 2 - 3>
We noticed that it doesn’t seem to be possible to filter for these values in Custom Reports. For example, based on the values above, we would like to create a report where
- CD1 begins with “abc_”
- CD1 contains “- 3>”
But 1) also returns results where CD1 = “abcde”, and 2) does not produce results at all, as if nothing is being found by the search.
So my question is: What are the rules for special characters in the search of the Custom Reports plugin? (which also seems to behave differently than the filter search used in the search filed below most standard plugins - where searching for “>” is completely fine.
Thanks for reporting this @cataclyst
This appears to be a bug in Custom Reports that does not allow the filter to properly search for strings containing angle brackets. I have created an internal issue for this and hopefully it will be resolved soon.
@cataclyst Just a follow-up from my last reply. It looks like Matomo does not use < & > directly due to potential code conflicts. The solution is to use the HTML character entity references
> with Custom Report filter conditions instead.
Hello @Joshua123, thank you for your inquiries and the workaround. Do you know if the same applies to filtering for underscores (
_ )? As I wrote above, filtering for
starts with abc_ behaves the same as
starts with abc - the underscore is ignored. So should filtering for
starts with abc_ work?
it’s recommended to refer to the official documentation […]
That’s exactly the problem, the official plugin documentation doesn’t mention any gotchas to watch out for when defining the filters, neither does the manual page, as far as I can see.
[…] or seek assistance from the Matomo community
I guess that is exactly what I am trying to do with this forum post. @Joshua123’s answer is helpful for
<, but the question still remains for underscores
_. I will try to verify if we can use the HTML entity for that on our side.
As this concerns Custom Reports Premium plugin, maybe @Joshua123 or @innocraft will give more info in this. If not, you can reach the support team directly by email.
@cataclyst I have been away for the last month. I am unable to reproduce this issue with an underscore…
If you are still having trouble, please email support and they can look into your specific problem further: https://matomo.org/support/