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

Fix goal metric processing for device type / model / brand #10873

Merged
merged 4 commits into from Nov 20, 2016

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Nov 15, 2016

Processing goal metrics for device type / model / brand was not working properly.

The visitor column value was not available when processing the goal conversion, which should be fixed with this changes.
I've also added some small tests to prove the goal metrics are processed correctly for device type / brand / model.

fixes #9777

@sgiehl sgiehl added 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. labels Nov 15, 2016
@sgiehl sgiehl added this to the 3.0.0-b4 milestone Nov 15, 2016
@@ -231,7 +231,7 @@ private function getVisitFieldsPersist()
$dimensions = VisitDimension::getAllDimensions();

foreach ($dimensions as $dimension) {
if ($dimension->hasImplementedEvent('onExistingVisit')) {
if ($dimension->hasImplementedEvent('onExistingVisit') || $dimension->hasImplementedEvent('onAnyGoalConversion')) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure it this is the correct solution.
Explanation why I've changed that:

I had following code in a visit dimension

    public function onAnyGoalConversion(Request $request, Visitor $visitor, $action)
    {
        return $visitor->getVisitorColumn($this->columnName);
    }

That didn't work properly, as the column didn't implement the onExistingVisit event (which simply isn't needed) and thus the property wasn't set for an existing visit.

Instead of this change here, I could also add an empty onExistingVisit event to the columns. But I think it is more useful this way.

@mattab @tsteur what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

👍 good solution

@sgiehl
Copy link
Member Author

sgiehl commented Nov 15, 2016

Failing UI tests seem not to be related to this PR.

@mattab mattab merged commit b5c4385 into 3.x-dev Nov 20, 2016
@mattab
Copy link
Member

mattab commented Nov 20, 2016

LGTM. I'll confirm on demo3 in coming days when the reports work 👍

@sgiehl sgiehl deleted the fixdevicegoalmetrics branch November 26, 2016 18:49
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.

Process Goal conversions, conversion rate, for each Device type, Device name, Device model
3 participants