@YueminJi opened this Issue on May 2nd 2018

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 commented on May 22nd 2018

@YueminJi I met this issue, how fix it?

@huang0808 commented on May 30th 2018

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

@YueminJi commented on May 30th 2018

@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 commented on June 1st 2018

@YueminJi thanks a lot, work well.

Powered by GitHub Issue Mirror