matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.63k stars 2.62k forks source link

Some goals have conversion rate more than 100% #1975

Closed mattab closed 13 years ago

mattab commented 13 years ago

Edit 2020: If you still experience this issue please leave a comment with a screenshot and some information.

Is this expected? if yes, create FAQ to explain why. If not, this is a bug to fix.

see http://forum.piwik.org/read.php?2,70802

sgiehl commented 13 years ago

I would suppose that is a bug. Checking the code I found this in plugins/Goals/Controller.php:

private function getConversionRateReturningVisitors( $idSite, $period, $date, $idGoal = false )
{
    // visits converted for returning for all goals = call Frequency API
    if($idGoal === false)
    {
        $request = new Piwik_API_Request("method=VisitFrequency.getConvertedVisitsReturning&idSite=$idSite&period=$period&date=$date&format=original");
        $nbVisitsConvertedReturningVisitors = $request->process();
    }
    // visits converted for returning = nb conversion for this goal
    else
    {
        $nbVisitsConvertedReturningVisitors = Piwik_Goals_API::getInstance()->getConversions($idSite, $period, $date, $segment=false,$idGoal);
    }
    // all returning visits
    $request = new Piwik_API_Request("method=VisitFrequency.getVisitsReturning&idSite=$idSite&period=$period&date=$date&format=original");
    $nbVisitsReturning = $request->process();

    return Piwik::getPercentageSafe($nbVisitsConvertedReturningVisitors, $nbVisitsReturning, Piwik_Goals::ROUNDING_PRECISION);
}

If I seen that right, if a goalid is given, the plugin uses the overall conversion rate for calculating the rate for returning visitors?

mattab commented 13 years ago

(In [4691]) Refs #898 Work in progress (but should leave trunk stable and not break anything)