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
Store visitorID related to userID to cookies #6838
Conversation
Hi @jantlwoomy thanks for your suggestion! It looks like a useful change, but it's lacking some tests to make sure it works as expected. Do you think you could try add some tests in this file: https://github.com/piwik/piwik/blob/master/tests/javascript/index.php#L405 these tests are executed in the Continuous integration so you can see whether the tests still pass after each of your commit. Let me know if you have some question... |
I can try, but not in next 2 weeks. |
No worries @jantlwoomy - this would be great and we'll wait 👍 |
+1 |
Please take a look. It's not much but I'm not sure what else we can test in this case. |
I just tested with this patch and without and that's what I got:
With:
|
@@ -160,8 +160,7 @@ public function getSegmentsMetadata($idSites = array(), $_hideImplementationData | |||
'name' => 'General_UserId', | |||
'segment' => 'userId', | |||
'acceptedValues' => 'any non empty unique string identifying the user (such as an email address or a username).', | |||
'sqlSegment' => 'log_visit.idvisitor', | |||
'sqlFilterValue' => array('Piwik\Common', 'convertUserIdToVisitorIdBin'), | |||
'sqlSegment' => 'log_visit.user_id', |
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.
could you remove this change from the PR as it was applied today to master?
I think there is a bug indeed, and this change corrects it. To keep the piwik.js consistent with the PHP client (on which other clients may be based) I would suggest to fix slightly different. In piwik.js Then whenever you use |
I've tried to remove excess commits and accidentally closed PR. Sorry for that. |
@jantlwoomy feel free to open new pull request and I'll do my best to get it merged quickly! |
FYI this will get reverted in #12742 |
When visitor is logging in and we are calling setUserID method, cookie value for uuid should be updated to this userID.
How it was before the fix:
How it is after the fix:
This case scenario works only if trust_visitors_cookies option is true.