-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
UserID overwrites VisitorID, but doesn't claim existing Visit #19927
Comments
Thanks for reporting this @SeverinEventfrog, the detail you've provided is very helpful 👍 Since this is a case of documented behavior no longer happening in the current release I'll mark this as a regression. |
Hey, im expiriencing the same issue. Could you please prioritize the issue higher, because it really messes up the tracking data. |
@mattab This appears to be the same issue as L3-265. Since it's a regression, should it be assigned to the next point release? |
@SeverinEventfrog @janinaMi Are you only using the |
@sgiehl I'm just using the setUserId method |
We also only use setUserId and we only use it after the user logs in. CookieConsent does specifically not trigger it. The moethod is only triggered after the correct userID is known. |
We have another user experiencing this issue. Due to how their website is setup it makes it appear as though 60% of their visits are from user that are not logged in, even though their website requires an account to access it. This leads to inaccurate reports for them because the existing visit is not claimed when the User ID is set. |
We have another customer who is experiencing this issue. They have a website where users are required to be signed in to view any pages and created a Custom Report to track certain actions. That report contains two specific metrics: The |
A customer has pointed out that because of this bug "we reported the wrong numbers" for more than half a year to senior management. |
Another customer reported the bug today:
|
Hi @Starker3 and @atom-box, we had a similar issue with one of our clients. While this approach didn't alter the Matomo statistics, it served as an effective workaround given that we where already generating custom (excel) reports for our clients. The specs we used to merge visits where:
A simple merger plugin for Matomo might be a handy solution for the future, since realizing this misconfiguration is quite frustrating. |
We have tried to reproduce this issue to understand exactly the scope of the problem. There were changes in Matomo 5 (PR 20096) related to the tracking requests that might address this so it would be good if the customers could confirm this is still an issue on Matomo 5. Additionally, we aren't seeing if this worked previously, hence removing the regression label. We acknowledge that there might be various issues around UserID tracking, but this will require a larger piece of work to fix holistically. Let us know when you bump into any related issues so we can look into it better. |
This issue has been mentioned on Matomo forums. There might be relevant details there: https://forum.matomo.org/t/two-sessions-instead-of-one-visitor-id-and-user-id/45230/9 |
This issue has been mentioned on Matomo forums. There might be relevant details there: https://forum.matomo.org/t/problem-with-changed-idvisitor-and-idvisit-after-login/53946/4 |
We're facing the same issue in Matomo 4.16.0 and also after updating to 5.0.1, same problem. As stated almost one and a half year ago according to this issue, the docs still claim: https://matomo.org/faq/general/how-are-requests-with-a-user-id-tracked/ Will this issue be fixed anytime soon? Or is the only way to solve this by setting the |
This issue has been mentioned on Matomo forums. There might be relevant details there: https://forum.matomo.org/t/is-visitor-data-merged-into-user-data-after-login/42511/3 |
The same problem for me, more or less. In my use case the user doesn't even need to log in. As soon as the user puts something in the cart, a new visitor profile is created and an "Abandoned Cart" event appears in the Matomo real-time view for this new visitor profile. The visit is split in 2 visitor profiles. :( |
This issue has been mentioned on Matomo forums. There might be relevant details there: https://forum.matomo.org/t/cid-not-being-enforced-although-sent/54953/3 |
@KarlGe |
Thanks for the suggestion, from the other replies it seemed like that wouldn't fix it but I will give it a try. |
Another Cloud customer is experiencing this issue. The have the same symptoms as I described above...
|
Just to confirm @Starker3 Then when I call setUserId, and trackPageView it will connect that to the previous unique visitor that had that userId, without assigning the first part of the visit to that user, hence creating two visits for this one visit This looks to be the exact same thing as 9joshua is describing |
I have the same issue. When I log in, a new visit started and did not merge with the current one. it is a SPA, so the user id is set before triggering pageview after login. Matomo version: 5.0.3 |
This issue has been mentioned on Matomo forums. There might be relevant details there: |
are there any updates on this? The issue is a wrong identity resolution, which corrupts pretty much all the numbers, making this a really big issue, since almost 1.5 years now. Quite some people flagged the issue also in the more recent versions of matomo, yet the issue is still flagged as |
We have been going through triaging process internally to triage all existing defects reported and we have triaged this issue and indeed it's turned out to be a higher priority compared to others. We will be looking to slot this into our Q3 BAU work. In the meantime, we have stopped recommending the User ID feature unless it’s critical for the customer’s tracking needs because this issue often interferes with their reports. We can also set enable_userid_overwrites_visitorid = 0 for customers where this happens - but the consequence is that they loose cross-device visit grouping. Hope this helps and appreciate you checking in 👍 |
A user reported this issue today.
(By the way, I made an internal ticket to add a warning to our UserID documentation: ticket KB-862) |
Is it relevant that 17002 says that |
We run a webshop. Users can put items in their basket and stroll around, but only need to login with a userId when starting the checkout proceedure. We want to have all actions pre-login also assigned to the userId. However, when enable_userid_overwrites_visitorid = 1 is set (is by default), then Matomo will not find the existing visit pre-login and instead create a new visit for the userId. Thereby loosing a lot of user interactions, like looking at products and not buying them.
Expected Behavior
enable_userid_overwrites_visitorid = 1
Navigate to the home page
1 visit with 1 action with unknown user
Navigate to the login screen
1 visit with 2 actions with unknow user
Login and call setUserId function
1 visit with 3 actions with known user (merging all pass actions)
Logout
1 visit with 4 actions with know user (it continues to put actions in the same visit)
Current Behavior
enable_userid_overwrites_visitorid = 1
Navigate to the home page without any Cookie
1 visit with 1 action with unknown user
Navigate to the login screen
1 visit with 2 actions with unknow user
Login and call setUserId function
1 visit with 2 actions with unknown user
1 visit with 1 action with known user (it didn't merged the pass actions)
Logout and no longer use setUserId
1 visit with 3 actions with unknow user
1 visit with 1 action with known user
Possible Solution
When userId overwrites visitorId, the check for existing visits should also check for visits of the visitorId, if that one is supplied. As when the visitorId is supplied, the trackingrequest clearly states to be from that visitor. So claiming the visit with the newly supplied userID is expected behaviour and even documented here: https://matomo.org/faq/general/how-are-requests-with-a-user-id-tracked/
"When a user logs in, Matomo counts all actions before and after logging in as one user, one visit, and one unique visitor."
Inuitively, this check could be done only, if no active visit for the userId is found.
However, I would suggest claiming the given visit even if another already assigned to the userId exists, as they might be from different devices within 20 minutes and just adding to the older one would disconnect the newer visits's previous actions from the userId.
Pseudocode:
get_existing_visit(visitorId, userId){
visits.add(get_visits_by_visitorId(visitorId)) # make sure, that visitorId has not already been overwriten by userId!
visits.add(get_visits_by_userId(userId))
visits.sort_by_last_action_time()
return visits.pop()
}
Steps to Reproduce (for Bugs)
See Behavior, we use JavaScript Tracking and the _paq.push(['setUserId', 'USER_ID_HERE']);
Context
In our Webshop, we want to know what a user has looked at and done during one sitting. If they happen to log in, we want all their actions to be mapped to their userID. We want this mapping to work, even if the user deletes their Cookies. We also want to be able to use the Matomo UI to click on Visitor-Profile and see all past actions of that User ( not only Visitor!).
We are aware of this option:
enable_userid_overwrites_visitorid = 0
Navigate to the home page
1 visit with 1 action with unknown user
Navigate to the login screen
1 visit with 2 actions with unknow user
Login and call setUserId function
1 visit with 3 actions with known user (just setting userID, vistorID unchanged)
Logout
1 visit with 4 actions with know user (it continued to put actions in the same visit)
But then, should the user ever delete their Cookie or much more likely just use another device, they would get another visitorID. The userID link is our active workaround but is slow for DB SELECTS and the Matomo Admin UI will only show all actions of the same VisitorID and not userID.
Your Environment
** FormAnalytics
** GoogleAnalyticsImporter
** HeatmapSessionRecording
** MediaAnalytics
For information:
The text was updated successfully, but these errors were encountered: