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

exit_rate & bounce_rate More than 100% #12808

Closed
dream-mind opened this issue May 2, 2018 · 5 comments
Closed

exit_rate & bounce_rate More than 100% #12808

dream-mind opened this issue May 2, 2018 · 5 comments
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@dream-mind
Copy link

IF Site has more than one domain(or use both android and iOS native SDK),exit_rate & bounce_rate may more than 100%

because /core/DataTable/Row.php use sum operation,But for the percentage value can't use sample sum operation, should use original molecular and denominator.

@huang0808
Copy link

@YueminJi I met this issue, how fix it?

@huang0808
Copy link

@Sija have you ways to fix the issue? thanks very much.

@dream-mind
Copy link
Author

@huang0808 here is my Temporary solutions
change core/DataTable/Row.php File like this

public function sumRow(Row $rowToSum, $enableCopyMetadata = true, $aggregationOperations = false)
    {
        foreach ($rowToSum as $columnToSumName => $columnToSumValue) {
            
            // fix bounce_rate
            if($columnToSumName == 'bounce_rate'){
                VarDumper::dump($this->getColumns('storage')['label']);
                $total_entry_bounce_count = (int)$this->getColumns('storage')['entry_bounce_count']+(int)$rowToSum->getColumns('storage')['entry_bounce_count'];
                $total_entry_nb_visits = (int)$this->getColumns('storage')['entry_nb_visits']+(int)$rowToSum->getColumns('storage')['entry_nb_visits'];
                $bounce_rate = number_format($total_entry_bounce_count/$total_entry_nb_visits,2);
               return $this->setColumn($columnToSumName, $bounce_rate);
            }
            // fix exit_rate
            if($columnToSumName == 'exit_rate'){
                VarDumper::dump($this->getColumns('storage')['label']);
                $total_exit_nb_visits = (int)$this->getColumns('storage')['exit_nb_visits']+(int)$rowToSum->getColumns('storage')['exit_nb_visits'];
                $total_nb_visits = (int)$this->getColumns('storage')['nb_visits']+(int)$rowToSum->getColumns('storage')['nb_visits'];
                $exit_rate = number_format($total_exit_nb_visits /$total_nb_visits,2);
               return $this->setColumn($columnToSumName, $exit_rate);
            }
            
            if (!$this->isSummableColumn($columnToSumName)) {
                continue;
            }

@huang0808
Copy link

@YueminJi thanks a lot, work well.

@Findus23 Findus23 added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label May 24, 2020
@sgiehl
Copy link
Member

sgiehl commented Nov 13, 2022

This one should have meanwhile be fixed.

@sgiehl sgiehl closed this as completed Nov 13, 2022
@sgiehl sgiehl removed the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Nov 13, 2022
@elabuwa elabuwa added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

5 participants