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
javascript site search reports results count from previous search #7816
Comments
Can you try with latest Piwik version? We do no longer support Piwik 1.X |
Sorry, typo, I'm using 2.12.1! |
I just tried to reproduce and thought I can but then I noticed there was a problem with my URL. Is it possible that you use fragments in the URL? Such as Can you also make sure it is not a problem in PHP? Eg can you check in the browser that the actual correct value is set in the HTML/JavaScript? |
No, no URL fragments. To illustrate further I've just done a test with the default Opencart 2.0.2.0 store (fresh install) and Piwik 2.12.1 as mentioned. I tried searching for 'mac' (4 results) then 'iphone' (1 result) then 'ipod' (4 results). The search URL is of the form However what I see in the Piwik visitor log is the first search 'mac' which should be 4 results, not show a result count figure at all, 'iphone' which should be 1 shows a results count of 4, and 'ipod' which should be 4 shows a results count of 1. See below when hovering over 'ipod' search; Yes its definitely not a PHP issue, e.g. on the final search results page for 'ipod' with four results this is the piwik javascript in the HTML source;
|
I'm trying to reproduce this already for a while and might think this could be a JavaScript issue somewhere here: https://github.com/piwik/piwik/blob/2.13.1/plugins/Live/javascripts/visitorLog.js#L43 I noticed kinda a similar issue. I had 3 searches under the same action, but they were grouped in JS so only the last search result was shown in the tooltip (or the first one not sure) |
It's actually because we use the @mattab ? |
@tsteur whatever is done should be on purpose, but if it causes this bug, something needs to be fixed :-) let's take a look at it for 2.15.0 |
FYI: Deleted 2 comments as they belong to a different issue |
I tried to reproduce for quite a while but couldn't. I also debugged the part from fetching the visitors from DB to displaying them in the UI and everything seems to be straight forward. So the only thing where something could go wrong would be the tracker but I kinda doubt that this is the problem. Can you maybe send us a link to your website and maybe a few steps to reproduce? Maybe it helps us to reproduce. If so, feel free to send us an email to "hello at piwik.org" then comment here (just in case the mail goes into spam). |
Thanks @tsteur for investigating @kevinb456 hopefully you can send us more information, we may not be able to fix it otherwise. |
Closing, @kevinb456 feel free to re-open and post more information. thx |
I am using Piwik 1.12.1 with opencart 2.0.2 , using the default site search query parameters which Piwik automatically gets the keywords from, then adding the count into the javascript footer as follows (as recommended on piwik documentation);
_paq.push(['setCustomUrl', document.URL + '&search_count=x']);
where x is the count value rendered by PHP for that results page.
When on a search results page for a product, with say 4 results, the javascript source correctly has "search_count=4" in it. However when I view the site search in Piwik the results count reported is not 4, but whatever number the previous site search had.
I can't think of anything I'm doing wrong so I'm assuming this is Piwiks bug. Happy to be proven wrong!
The text was updated successfully, but these errors were encountered: