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
Function getPiwikUrlForOverlay returns wrong URL when it receives different URL than suffixed with piwik.php #9467
Comments
Here's a proposed function:
|
@kaz231 There is a similar problem when one uses the var piwikTracker = Piwik.getTracker(pkBaseURL + "js/", 1); add following line: piwikTracker.setAPIUrl(pkBaseURL); The closest one comes to in terms of documentation on this is following under https://piwik.org/docs/page-overlay/#page-overlay-troubleshooting:
See also: http://forum.piwik.org/t/piwik-1-10-page-overlay/8706?page=3 Please note that if using the /js directory as described in that README.md file, you won't need to do the "Deployment" part. It's already done. You would just need to:
@piwik-devs On a side note, the above information could be added to the above README.md file. Alternatively, the call of |
PR: #9470 |
Unfortunately, this won't work as we can't update quickly tracking codes on hundreds of websites. |
Maybe it would be easier and more fail proof to check whether it ends with |
In such case https://github.com/piwik/piwik/blob/master/js/tracker.php won't work. |
We could on top check for an ending |
As I said, this is only to catch protocol://domain.tld[port]/ of given URL. We don't analyze rest of it, so that's why I didn't consider any other characters that could be available only in query path. This regex is really simple. We goal is to have only domain with protocol and port at the end, because we found a case when Piwik tries to load resource from plugin, so removing of the filename won't give us anything. We want to fix it once and never come back to it. The solution that I proposed solves the problem. |
What if Piwik is installed under |
also: what if Piwik is installed under a unicode domain name? eg. |
Can you test this patch: #9775 ? I reckon it should fix it |
Sure, I will test it this week. |
@tsteur I tested and it works correctly. |
If we are using e.g. "http://my.local/js/tracker.php" as piwikUrl in piwik.js, then Overlay tries to load following resource: https://my.local/js/tracker.phpplugins/Overlay/client/client.js?v=1 .
It's because of this line https://github.com/piwik/piwik/blob/2.15.0/js/piwik.js#L2632 that recognizes only URLs suffixed with "piwik.php".
Goal is to instead of removing previously defined suffix, create a function that will remove protocol://domain.tld[port]/ .
The text was updated successfully, but these errors were encountered: