-
-
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
JS Tracker, New method resetUserId
to de-assign a user id after a logout
#12141
JS Tracker, New method resetUserId
to de-assign a user id after a logout
#12141
Conversation
Tests pass except for the screenshot thing. Is that a signal or noise? |
nice! |
it's noise |
Thanks for creating this Pull request @znerol 👍 Feedback:
@znerol feel free to make the changes, otherwise we will likely work on this next month. |
… visitor id value from cookie
Update PR, I've opted for |
Should I squash the commits? (Except for the minify piwik.js one.) |
tracker.setUserId(false); | ||
ok(getVisitorIdFromCookie(tracker).length == 16, "after setting empty user id, visitor ID from cookie should still be 16 chars, got: " + getVisitorIdFromCookie(tracker)); | ||
equal(getVisitorIdFromCookie(tracker), visitorId, "after setting empty user id, visitor ID from cookie should be the same as previously ("+ visitorId +")"); | ||
tracker.resetUserId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here could you also test that getUserId is empty string ?
Thanks for updating the PR! fyi: It's not needed to squash commits as when we merge it will squash them. Code review
after merge will need to update the documentation in: https://developer.matomo.org/api-reference/tracking-javascript
|
Implements the new resetUserId() method from JS tracker in matomo-org/matomo#12141 matomo-org/matomo#7556
-> Check out the documentation for this new feature here: https://developer.matomo.org/guides/tracking-javascript-guide#when-user-logs-out-reset-user-id it is available in Matomo 3.4.0 due to release today 🎉 |
resetUserId
to de-assign a user id after a logout
Replicates the user-signout mechanism from the PHP tracker in order to fix #7556