Skip to content
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

piwik.php url download query parameter is case sensitive #14396

Closed
MERamadan opened this issue May 1, 2019 · 2 comments
Closed

piwik.php url download query parameter is case sensitive #14396

MERamadan opened this issue May 1, 2019 · 2 comments
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.

Comments

@MERamadan
Copy link

Issue:
When posting a download action with query parameter Downalod (capital D), it is tracked as a page view instead of download action.

Excepted:
All query parameter keys should be case insensitive to avoid similar issues.

Generate Steps:

Related Issue (Matomo .Net Client):
matomo-org/piwik-dotnet-tracker#68

@MERamadan
Copy link
Author

MERamadan commented May 1, 2019

Proposed Solution:
File: matomo\core\Tracker\Request.php
Added the following line to lower incoming request query keys before set this->params
$params=array_change_key_case($params, CASE_LOWER);

Complete Code:

public function __construct($params, $tokenAuth = false)
    {
        if (!is_array($params)) {
            $params = array();
      }			
	$params=array_change_key_case($params, CASE_LOWER);
       /**....same old code....**/

@tsteur tsteur added the duplicate For issues that already existed in our issue tracker and were reported previously. label May 1, 2019
@tsteur
Copy link
Member

tsteur commented May 1, 2019

Hi there, the proposed solution could break a lot of things. In general, the last time this was suggested it was closed because urls are usually not case insensitive see #10534

You would implement this in the client you use. For example if you use JS, and want pageviews to be case insensitive, you could do something like _paq.push(['setCustomUrl', location.href.toLowerCase()]). Similar things probably work in the dot net tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

2 participants