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
<a href='/1'>#1</a> to
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:
@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
@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" ?
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
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.
visitor_count_visits column doesn't help either?
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...
Actually, if I see this right, the visitor count comes from a param
_idvc so this is not reliable :(
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?
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.