-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Match configId even when userId is found #15337
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,8 @@ | |
<serverTimePretty>Mar 6, 2010 13:22:33</serverTimePretty> | ||
<pageId>5</pageId> | ||
<bandwidth /> | ||
<timeSpent>360</timeSpent> | ||
<timeSpentPretty>6 min 0s</timeSpentPretty> | ||
<interactionPosition>2</interactionPosition> | ||
<title>incredible title!</title> | ||
<subtitle>http://example.org/index.htm</subtitle> | ||
|
@@ -111,15 +113,6 @@ | |
<timestamp>1267881753</timestamp> | ||
<bandwidth_pretty>0 M</bandwidth_pretty> | ||
</row> | ||
</actionDetails> | ||
<lastActionDateTime>2010-03-06 13:22:33</lastActionDateTime> | ||
<userId>[email protected]</userId> | ||
<actions>2</actions> | ||
</row> | ||
<row> | ||
<idVisit>4</idVisit> | ||
<visitorId>6ccebef4faef4969</visitorId> | ||
<actionDetails> | ||
<row> | ||
<type>action</type> | ||
<url>http://example.org/index.htm</url> | ||
|
@@ -129,7 +122,7 @@ | |
<serverTimePretty>Mar 6, 2010 13:28:33</serverTimePretty> | ||
<pageId>6</pageId> | ||
<bandwidth /> | ||
<interactionPosition>1</interactionPosition> | ||
<interactionPosition>3</interactionPosition> | ||
<title>second page</title> | ||
<subtitle>http://example.org/index.htm</subtitle> | ||
<icon /> | ||
|
@@ -140,10 +133,10 @@ | |
</actionDetails> | ||
<lastActionDateTime>2010-03-06 13:28:33</lastActionDateTime> | ||
<userId>[email protected]</userId> | ||
<actions>1</actions> | ||
<actions>3</actions> | ||
</row> | ||
<row> | ||
<idVisit>5</idVisit> | ||
<idVisit>4</idVisit> | ||
<visitorId>2f16b4d842cc294d</visitorId> | ||
<actionDetails> | ||
<row> | ||
|
@@ -169,7 +162,7 @@ | |
<actions>1</actions> | ||
</row> | ||
<row> | ||
<idVisit>6</idVisit> | ||
<idVisit>5</idVisit> | ||
<visitorId>7dcebef4faef4969</visitorId> | ||
<actionDetails> | ||
<row> | ||
|
@@ -274,7 +267,7 @@ | |
<actions>3</actions> | ||
</row> | ||
<row> | ||
<idVisit>7</idVisit> | ||
<idVisit>6</idVisit> | ||
<visitorId>7dcebef4faef4325</visitorId> | ||
<actionDetails> | ||
<row> | ||
|
@@ -300,7 +293,7 @@ | |
<actions>1</actions> | ||
</row> | ||
<row> | ||
<idVisit>8</idVisit> | ||
<idVisit>7</idVisit> | ||
<visitorId>6ccebef4faef4969</visitorId> | ||
<actionDetails> | ||
<row> | ||
|
14 changes: 7 additions & 7 deletions
14
tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_day.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<result> | ||
<nb_uniq_visitors>6</nb_uniq_visitors> | ||
<nb_uniq_visitors>5</nb_uniq_visitors> | ||
<nb_users>2</nb_users> | ||
<nb_visits>6</nb_visits> | ||
<nb_visits>5</nb_visits> | ||
<nb_actions>10</nb_actions> | ||
<nb_visits_converted>1</nb_visits_converted> | ||
<bounce_count>3</bounce_count> | ||
<sum_visit_length>1623</sum_visit_length> | ||
<bounce_count>2</bounce_count> | ||
<sum_visit_length>1983</sum_visit_length> | ||
<max_actions>3</max_actions> | ||
<bounce_rate>50%</bounce_rate> | ||
<nb_actions_per_visit>1.7</nb_actions_per_visit> | ||
<avg_time_on_site>271</avg_time_on_site> | ||
<bounce_rate>40%</bounce_rate> | ||
<nb_actions_per_visit>2</nb_actions_per_visit> | ||
<avg_time_on_site>397</avg_time_on_site> | ||
</result> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_week.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<result> | ||
<nb_uniq_visitors>6</nb_uniq_visitors> | ||
<nb_uniq_visitors>5</nb_uniq_visitors> | ||
<nb_users>2</nb_users> | ||
<nb_visits>6</nb_visits> | ||
<nb_visits>5</nb_visits> | ||
<nb_actions>10</nb_actions> | ||
<nb_visits_converted>1</nb_visits_converted> | ||
<bounce_count>3</bounce_count> | ||
<sum_visit_length>1623</sum_visit_length> | ||
<bounce_count>2</bounce_count> | ||
<sum_visit_length>1983</sum_visit_length> | ||
<max_actions>3</max_actions> | ||
<bounce_rate>50%</bounce_rate> | ||
<nb_actions_per_visit>1.7</nb_actions_per_visit> | ||
<avg_time_on_site>271</avg_time_on_site> | ||
<bounce_rate>40%</bounce_rate> | ||
<nb_actions_per_visit>2</nb_actions_per_visit> | ||
<avg_time_on_site>397</avg_time_on_site> | ||
</result> |
12 changes: 6 additions & 6 deletions
12
tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_year.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<result> | ||
<nb_visits>8</nb_visits> | ||
<nb_visits>7</nb_visits> | ||
<nb_actions>12</nb_actions> | ||
<nb_visits_converted>1</nb_visits_converted> | ||
<bounce_count>5</bounce_count> | ||
<sum_visit_length>1623</sum_visit_length> | ||
<bounce_count>4</bounce_count> | ||
<sum_visit_length>1983</sum_visit_length> | ||
<max_actions>3</max_actions> | ||
<bounce_rate>63%</bounce_rate> | ||
<nb_actions_per_visit>1.5</nb_actions_per_visit> | ||
<avg_time_on_site>203</avg_time_on_site> | ||
<bounce_rate>57%</bounce_rate> | ||
<nb_actions_per_visit>1.7</nb_actions_per_visit> | ||
<avg_time_on_site>283</avg_time_on_site> | ||
</result> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@diosmosis @mattab noticing this would create a new visit when userId was previously set, and then user logs out using resetUserId. I suppose this is not what we want as we also don't create a new visit when userId is set initially. I suppose we maybe really only always want to add
AND ( user_id IS NULL OR user_id = ? )
when userId is not empty?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.
Also when user is found by idVisitor, then we would also not create a new visit after resetUserId so we need to make sure to have consistent behavior no matter if cookies are enabled or disabled... I will later change the query I reckon to only compare userId when a userId is set
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.
If userId is null, we'd want to look for ( user_id IS NULL ) though, correct? Otherwise it would match the logged out user. Then again, ( user_id IS NULL OR user_id = ? ) would also match the user after they login (ie, logged out => login), so maybe both behaviors are desired?
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.
That's current desired/ implemented behaviour AFAIK and that's how it also works when it matches the visit by visitorId. See thread in matomo-org/developer-documentation#320
We just need to make sure to always have consistent behaviour on log in and log out. Either we always create a new visit on log in and log out, or never.
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.
I thought the point of separating user ID from visitor ID was so you could tell when a user logged in/out. Ie, it would count as the same visitor (along with same user different idvisitor being different visitors but one user), but count as different users? Maybe this isn't clear anymore w/ the userid change...
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.
I'm not sure? If that's the case, then I think this wasn't implemented.
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.
I think you're right it was never implemented. It does seem more useful to me though. I guess it could go in another issue.