@kumar-ebalnasral opened this Issue on September 21st 2018

I’m using Matomo 3.6.0
I described issue in details on matomo forum
Matomo removes broad match modifier (plus sign) from keywords and replace it with space character.
The source of issue is urldecode function. As urlencode documentation says:

Returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent ( % ) sign followed by two hex digits and spaces encoded as plus ( + ) signs. It is encoded the same way that the posted data from a WWW form is encoded, that is the same way as in application/x-www-form-urlencoded media type. This differs from the » RFC 3986 encoding (see rawurlencode()) in that for historical reasons, spaces are encoded as plus (+) signs.

So urldecode consider plus sign in string as encoded space character and decode it accordingly.
But in this case the result is incorrect and undesirable cause +women’s +hats and women’s hats are different search keywords.
Saving keyword modifiers is necessary for analytics purposes.

Is it safe to replace all urlencode/urldecode functions with it's raw- analogues?

P.S. match modifiers docs
https://support.google.com/google-ads/answer/2497836?hl=en 1

@kumar-ebalnasral commented on October 5th 2018

@tsteur @mattab @sgiehl
Is there a chance to get a feedback from the matomo team?

@mattab commented on October 7th 2018 Member

Is it safe to replace all urlencode/urldecode functions with it's raw- analogues?

Hi there, personally I don't know if it's safe or what it would change. So I suggest you create a branch with your changes, test them, and then open a pull request with your proposed changes if they work? See some pointers in https://developer.matomo.org/guides/contributing-to-piwik-core

Powered by GitHub Issue Mirror