Skip to content
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

Faster segmented suggested values when browser archiving is disabled #15786

Merged
merged 8 commits into from Apr 14, 2020

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Apr 7, 2020

fix #15732

Also fixes an issue where the wrong segment metadata was created for Page URL/Title not defined and eg segmented visitor log did not work for these.

@tsteur tsteur added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Apr 7, 2020
@tsteur tsteur added this to the 3.13.5 milestone Apr 7, 2020
@tsteur tsteur added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Apr 8, 2020
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. Otherwise looks good and works 👍
Should we maybe create a follow up issue to add that feature to other dimensions as well? 🤔

public function setSuggestedValuesApi($suggestedValuesApi)
{
if (!empty($suggestedValuesApi) && is_string($suggestedValuesApi)) {
if (Development::isEnabled() && strpos($suggestedValuesApi, '.get') === false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess we can ignore that this might throw a warning in development mode if setSuggestedValuesApi is called with something else than a string

}
}

$flat = strpos($segment['suggestedValuesApi'], 'Actions.') === 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if there would be a better solution than hardcoding that for Actions only. Maybe we could always flatten the report if the API method has subtables with the same dimension or something like that 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had it hard coded flattened initially, but then noticed there was an issue with the content dimensions for example where it then would return content name - content piece instead of just content name. technically, I suppose we could check the metadata and see if there is a subtableApiMethod defined and whether it is the same API method or a different one. Should there be a different api method we could disable flattening. Was hoping though to not needing to do it simply to keep things simple. I suppose it wouldn't be that complex though maybe. Will check later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it @sgiehl

@@ -624,8 +626,6 @@ public function getSuggestedValuesForSegment($segmentName, $idSite)
);
if (!empty($segment) && preg_match('/^' . implode('|',$remove) . '/', $segment)) {
$values[] = urldecode(urldecode(str_replace($remove, '', $segment)));
} else {
$values[] = $row->getColumn('label');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing that actually requires a segment metadata to be set, right? should we maybe mention that in the doc block of setSuggestedValuesApi

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 👍

@sgiehl sgiehl merged commit a4e60ad into 3.x-dev Apr 14, 2020
@sgiehl sgiehl deleted the m15732 branch April 14, 2020 06:24
diosmosis added a commit that referenced this pull request Apr 16, 2020
* Avoid possible error subtable already exists but not loaded (#15779)

* Make sure to always set JSON_PIWIK to native JSON when possible (#15785)

* make sure to always set JSON_PIWIK to native JSON when possible

* rebuilt piwik.js

* Force POST for bulk requests, fix alwaysUseSendBeacon not respected for bulk requests (#15784)

* Force POST for bulk requests, fix alwaysUseSendBeacon not respected for bulk requests

* rebuilt piwik.js

* Make sure to clean up tracking failures before sending email notification (#15798)

Feedback from a customer... Eg the daily `cleanupTrackingFailures()` action might be only executed after the weekly `notifyTrackingFailures` therefore we should try to clean up failures first and then check if any are left. Avoids the case where a user opens hours later the email they receive and then there are no tracking failures reported. This could still happen but it's a bit less likely.

* 3.13.5-b1

* Faster segmented suggested values when browser archiving is disabled (#15786)

* Faster segmented suggested values when browser archiving is disabled

* make sure no segment is set

* remove wrong var type

* fix/add tests

* add more segment values

* detect if we should flatten or not

* add docs

* Fix problem when comparing segments or opening popovers (#15809)

refs #15805

* purge all old archives regardless of done value (#15800)

* purge all old archives regardless of done value, we only care about the newest usable one

* Fix test and start on new one.

* Add coverage for change in tests.

* there is no longer an inner join so should not need the idsite check

* Add more parameters to the computeNbUnique event (#15808)

* 3.13.5-b2

* One click update in two parts so new code is loaded for second. (#15770)

* One click update in two parts so new code is loaded for second.

* remove no longer needed code

Co-authored-by: Thomas Steur <tsteur@users.noreply.github.com>
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
Co-authored-by: Stefan Giehl <stefan@matomo.org>
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Apr 28, 2020
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
…atomo-org#15786)

* Faster segmented suggested values when browser archiving is disabled

* make sure no segment is set

* remove wrong var type

* fix/add tests

* add more segment values

* detect if we should flatten or not

* add docs
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
…atomo-org#15786)

* Faster segmented suggested values when browser archiving is disabled

* make sure no segment is set

* remove wrong var type

* fix/add tests

* add more segment values

* detect if we should flatten or not

* add docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants