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

Wrong statistic if same parameter is used several times in the query string #9842

Open rristow opened 8 years ago

rristow commented 8 years ago

Piwik (php) will not store the complete URI if the query part of the URI has more than one parameter with the same key/name. e.g. http:/mydomain.com?selected_colors=red&selected_colors=blue&par3=1

It's a little bit strange to have parameter with the same name, but there are some systems that use this technic (like plone4) and I didn't find a clear definition about this in the "rfc3986". The main problem is that the link in the reports (like 'Visitor Profile report') will be truncate . e.g. http:/mydomain.com?selected_colors=red&par3=1

tsteur commented 8 years ago

Thank you @rristow Independent of any rfc I would say this is a bug. Piwik should not change the URL that was sent via the Tracking API. I think eg in angular this is valid and someone would get an array for selected_colors in this case

rristow commented 8 years ago

Is there a workaround for this?

tsteur commented 8 years ago

Unfortunately I cannot think of any workaround for this right now

webmaxttor commented 7 years ago

@mattab - All forms with lists are actually "misinterpreted" in piwik. Is this bug not serious? Because campains can be based on survey-forms. And all answers from lists, check-boxes, etc... will be "wrong" in piwik. Take a look here:
http://stackoverflow.com/questions/724526/how-to-pass-multiple-parameters-in-a-querystring https://msdn.microsoft.com/en-us/library/ms524784(v=vs.90).aspx

rristow commented 7 years ago

@mattab - May I ask if there some input here?

sscots commented 3 months ago

+1

If you're using javascripts UrlSearchParams object (https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams), it will build an array parameter in this way.