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.71k stars 2.62k forks source link

Issue with Regex in Goals #21164

Open Birkaransingh94 opened 1 year ago

Birkaransingh94 commented 1 year ago

Hi Team,

There's an issue when a page visits goal has been setup with regex: For E.g: Correct Regex is: https:\/\/example.example.co.uk\/checkout\/ABCD[0-9]+\/$

However, when saving it in goals, it removes "+" from the regex and saves it as: https:\/\/example.example.co.uk\/checkout\/ABCD[0-9] \/$

Thanks.

michalkleiner commented 1 year ago

Yeah, I can see how that would happen as + is a space in the URL format.

michalkleiner commented 1 year ago

Mildly related to #20875 where the validation would also help see this issue.

sgiehl commented 1 year ago

This looks like another problem related to https://github.com/matomo-org/matomo/issues/4231, but might already be possible to solve that by switching the goals api to use unsanitized parameters. See https://github.com/matomo-org/matomo/pull/19624

michalkleiner commented 1 year ago

@Birkaransingh94 can you see if Stefan's suggestion to switch the goals api to using unsanitised parameters helps?

sgiehl commented 1 year ago

@michalkleiner This is something we would need to do in the code

michalkleiner commented 1 year ago

Ah right, I thought that was already an existing option. Apologies for the confusion.

ampaze commented 1 year ago

Is someone working on this? As Matomo does not support Goal Tracking for past events, saving/creating an goal with .+ in the regex will lose valuable information.

michalkleiner commented 1 year ago

Not that I'm aware of at the moment, @ampaze. If you're keen to provide a PR we'll definitely look at it, otherwise it'll be up to the product team to prioritise the work on this.