Handling user switching #165
Unanswered
foureight84
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I've noticed that when switching to a new user, tracking data is still associated with the first logged in user. I assume this is due to the VisitorId being stored. However, I've tried calling
MatomoTracker.instance.clear()but that doesn't seem to make a difference. I suppose this means that Matomo needs to be reinitialized on logout? not sure if there's a different strategy to handle this?EDIT:
What I ended up doing that seems to work is keeping
MatomoTracker.instance.clear()upon logout but also addedMatomoTracker.instance.setVisitorUserId()upon successful login. However, I noticed that the visitor profile id has not changed. I do clear shared preferences upon logout as well.All reactions