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

Problem with old visits using userID #12574

Closed
tpapaj-CKPL opened this issue Feb 21, 2018 · 1 comment
Closed

Problem with old visits using userID #12574

tpapaj-CKPL opened this issue Feb 21, 2018 · 1 comment
Labels
wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.

Comments

@tpapaj-CKPL
Copy link

Hello, there's a problem in Matomo with leaving old "userID-empty" visits when visitor gets own userID when that userID already has a visit.
I'm using newest version of Matomo(3.3.0).

How to reproduce:

  • Use private mode or something to make your browser "clean" so you are counted as a new, fresh visitor.
  • Generate some actions on tracked page. For example generate 5 actions: now there is one visit with 5 actions for visitor without any userID.
  • Next action(for example logging in) should give that visitor some userID not used in any current ongoing visit. Matomo will replace empty userID for that visit with correct one and change visitorID if needed. Our "userID-less" visit with 5 actions now has userID and 6 actions. So far everything is correct.
  • Make your browser clean again so you are counted as a second visit. For example generate 3 actions so there's a new visit with 3 actions.
  • In this point we have two visits: first one with 6 actions and userID, second one with 3 actions and no userID.
  • Next action(logging in) for that second visit should give this visitor the same userID as in previous visit, this needs to happen before visit timeout for that first visit. Matomo will recognize the user and new events will be connected to the previous visit that had userID.
  • Here is where the problem begins: Matomo starts counting all actions again for the first visit with userID but it leaves previous actions from second visit.
  • In this moment we have two visits: first one with 7 actions and userID, second one with 3 actions and no userID.

What should happen instead? That second visit with 3 actions should be connected to that first visit.

Why there's a problem? When last visit for reused userID already ended because of timeout, there's no problem because Matomo just updates record with new visit and writes new userID for the visit. When there's ongoing visit for that userID, Matomo can't just update userID for the new visit because there would be two separate visits for the same userID that hasn't ended yet but current Matomo reaction to this situation also isn't good because it can create false data about users that end their visits on login website.

The best way to fix it from the functional side would be to update idvisit of all old events from piwik_log_link_visit_action with the correct one and delete that second visit from database. This would merge these visits and leave only correct one. I don't know however if this wouldn't create too much load(searching the data with specific idvisit).

@mattab
Copy link
Member

mattab commented Nov 2, 2019

Here is where the problem begins: Matomo starts counting all actions again for the first visit with userID but it leaves previous actions from second visit.
[...] When there's ongoing visit for that userID, Matomo can't just update userID for the new visit because there would be two separate visits for the same userID that hasn't ended yet

Currently it is by design, if the second "visit" happens within 30min of the first one, then the actions/pageviews/etc will be added to the existing visit as per the visit definition in https://matomo.org/faq/general/faq_36/

but current Matomo reaction to this situation also isn't good because it can create false data about users that end their visits on login website.

It would be interesting to know when a logout/login happens though, as it may indicate some issue or bug in the website/app... What I would recommend is that, when users login again, you could force Matomo to create a new visit manually yourself, see: https://matomo.org/faq/how-to/faq_187/

(I reckon we won't change this behavior in Matomo because it would be hard to detect + it would probably end up creating too many visits in some cases when for example on one page you forget to set a User ID and on the next page you set it again. Will mark as closed for now but we could reopen if needed)

@mattab mattab closed this as completed Nov 2, 2019
@mattab mattab added the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

2 participants