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

Visitor Profile with more than 100 visits shows negative visits #14308

Closed
mattab opened this issue Apr 2, 2019 · 8 comments · Fixed by #16247
Closed

Visitor Profile with more than 100 visits shows negative visits #14308

mattab opened this issue Apr 2, 2019 · 8 comments · Fixed by #16247
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Apr 2, 2019

When loading the Visitor Profile for a Visitor that visited the website more than 100 times, then when loading more visits (clicking 10 times on "Load more visits" or so), the visit count end up showing a negative number #-3, when we expected visits count to go from #1 to #1xx

URL to reproduce: https://demo.matomo.org/index.php?module=CoreHome&action=index&date=today&period=week&idSite=1&updated=4#?idSite=1&period=week&date=today&category=General_Visitors&subcategory=Live_VisitorLog&popover=visitorProfile$3Ab3b6d6a3249bc1fb&segment=visitCount%3E%3D200

Screenshot showing the problem:
negative visits

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Apr 2, 2019
@mattab mattab added this to the 3.13.0 milestone Apr 2, 2019
@sgiehl
Copy link
Member

sgiehl commented Jul 15, 2019

@mattab We are building up all the data summarized in the profile based on the last 100 visits (if not configured higher). So it might be correct to simply hide the "show more" link as soon as those 100 visits are shown

@mattab
Copy link
Member Author

mattab commented Aug 9, 2019

@sgiehl we can't really hide the "show more" link as it's important we give access to users to all their data that is stored and available in Matomo. When there are >= 100 visits, could we maybe issue a SQL query to count() how many total visits there are for this visitor, and use this value to write "Visit #xyz" instead of "Visit #100" ?

@sgiehl
Copy link
Member

sgiehl commented Aug 10, 2019

I'm not sure if it's a good idea to do that. The query for getting the visits is already quite slow for bigger databases. Adding another query that needs to check the whole table for matching visits might make it even worse.
It might also make the improvement by @tsteur in #14700 kind of useless for this case

@tsteur
Copy link
Member

tsteur commented Aug 10, 2019

A count(*) is definitely not an option.

Would we be able to rename the visits when loading more like starting with #visit 200 or so etc once 100 more are loaded? I know it's not an ideal solution, but there likely won't be an ideal solution.

I suppose visitor_count_visits column doesn't help either?

@sgiehl
Copy link
Member

sgiehl commented Aug 11, 2019

If the value in visitor_count_visits always holds the total number of visits the user had, we could use it as number to start with. Even though it might be possible that the number of visits that can be shown might be lower if some visits have been deleted through data retention settings. But we maybe could show a message explaining that if the number differs...

@tsteur
Copy link
Member

tsteur commented Aug 11, 2019

Actually, if I see this right, the visitor count comes from a param _idvc so this is not reliable :(

@sgiehl
Copy link
Member

sgiehl commented Aug 12, 2019

Then I guess the simplest solution would be to update the numbers of the already displayed visits? Eg when some loads another 10 visits after 100 already displayed, it would update the first visits displayed to 110 and so on, so the last one displayed again has number 1. Not an ideal solution, but still better to display negative numbers, right?

@tsteur
Copy link
Member

tsteur commented Aug 13, 2019

Sounds good.
On the other side... what if we put more focus on the date which seems way more relevant than a random visit number? Do we even need this visit number? Looking it at it, I'm not finding it too valuable. The date be more valuable.

The very first visit should maybe say something like Most recent visit so it's clear it's not the very first visit but the last visit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
3 participants