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

Disparity on how Intranet and Web sites deal with UserId #17002

Open
alexandrejobin opened this issue Dec 22, 2020 · 6 comments
Open

Disparity on how Intranet and Web sites deal with UserId #17002

alexandrejobin opened this issue Dec 22, 2020 · 6 comments
Labels
c: Data Integrity & Accuracy c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base.

Comments

@alexandrejobin
Copy link

alexandrejobin commented Dec 22, 2020

I tried to play with the UserId feature on Matomo 4.1.0 and I discovered that the statistics are differents if you track a Website vs an Intranet website.

Stats when tracking an Intranet

  1. Navigate to the home page with Edge browser
    • 1 visit with 1 action with unknown user
  2. Navigate to the login screen
    • 1 visit with 2 actions with unknow user
  3. 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)
  4. Logout and call resetUserId function
    • 1 visit with 3 actions with unknow user
    • 1 visit with 1 action with known user

Stats when tracking a Website

  1. Navigate to the home page with Edge browser
    • 1 visit with 1 action with unknown user
  2. Navigate to the login screen
    • 1 visit with 2 actions with unknow user
  3. Login and call setUserId function
    • 1 visit with 3 actions with known user (it merged the pass actions)
  4. Logout and call resetUserId function
    • 1 visit with 4 actions with know user (it continued to put actions in the same visit)

So at the end, when you track an Intranet site, it doesn't merge pass actions and for a Website, it merge it. Is it normal?

For information:

  • Matomo 4.1.0 on Windows
  • Edge 87 without adblocker
@tsteur
Copy link
Member

tsteur commented Dec 22, 2020

Hi @alexandrejobin when you use an "intranet" site then "we trust cookies" and as a result this could be indeed a side effect. I'm assuming this is because usually we would identify the previous visit because of the configId. But now because the visitorId changes when you use the userId feature and we only look for the visitorId it would create a new visit.

I didn't actually try to reproduce this but looking at code this seems to be what is happening.

There is a config setting to change this userId behaviour and you could try changing this in config/config.ini.php if you wanted both to behave the same. Add this to the config:

[Tracker]
enable_userid_overwrites_visitorid = 0

If [Tracker] exists in the config then you would only add the other line to the Tracker section. This would change it for all websites and intranets though and it basically means if the same user use different devices then they won't be shown as the same "visitor" in Matomo.

We might need to adjust https://matomo.org/faq/how-to/faq_19/ and potentially also the userId guide.

@mattab I suppose this is some expected behavior when using userId feature with an intranet website? At least I wouldn't know a way to change this except for on demand for an intranet site setting enable_userid_overwrites_visitorid = 0 but then you don't get information for the same user when they use different devices so that's likely not a good idea.

@tsteur tsteur added the c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base. label Dec 22, 2020
@tsteur tsteur added this to the 4.3.0 milestone Dec 22, 2020
@alexandrejobin
Copy link
Author

I will try to add enable_userid_overwrites_visitorid = 0 to my config because I have a mix of extranet and intranet and I would prefer that all sites get the same logic. But my preference would be that one an anonymous user log to the application that we can merge all his pass actions because this is in fact his actions and we can get a better view of what this user is doing.

Thank you for your quick response!

@alexandrejobin
Copy link
Author

I've just tested the enable_userid_overwrites_visitorid = 0 and it have no effect. When I test a Website, it have the same behavior as described in the first post.

@tsteur
Copy link
Member

tsteur commented Dec 23, 2020

Hi @alexandrejobin just double checking that enable_userid_overwrites_visitorid =0 is part of the [Tracker] section? Does it have an effect on the intranet measurable?

@alexandrejobin
Copy link
Author

hi @tsteur

If enable_userid_overwrites_visitorid = 0 is part of the [Tracker] section, both website and intranet react the same:

  1. Navigate to the home page with Edge browser
    • 1 visit with 1 action with unknown user
  2. Navigate to the login screen
    • 1 visit with 2 actions with unknow user
  3. Login and call setUserId function
    • 1 visit with 3 actions with known user (it merged the pass actions)
  4. Logout and call resetUserId function
    • 1 visit with 4 actions with know user (it continued to put actions in the same visit)

Maybe I don't understand correctly but this is like if the enable_userid_overwrites_visitorid = 0 is doing, in fact, what enable_userid_overwrites_visitorid = 1 should do.

@tsteur
Copy link
Member

tsteur commented Jul 22, 2021

only needs documenting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Data Integrity & Accuracy c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base.
Projects
None yet
Development

No branches or pull requests

3 participants