@alexandrejobin opened this Issue on December 22nd 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 commented on December 22nd 2020 Member

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.

@alexandrejobin commented on December 23rd 2020

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 commented on December 23rd 2020

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 commented on December 23rd 2020 Member

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 commented on January 7th 2021

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.

Powered by GitHub Issue Mirror