ConversionHandlers :: onGetRateTypes: Bitrix method

      
<?php 
//  Bitrix\Advertising\Internals\ConversionHandlers :: onGetRateTypes()
//  /dist/bitrix/modules/advertising/lib/internals/conversionhandlers.php:32

    
public static function onGetRateTypes()
    {
        
$scale = array(0.511.525);

        return array(
            
'advertising_banner_click' => array(
                
'NAME'      => Loc::getMessage('ADVERTISING_CONVERSION_RATE_BANNER_CLICK_TITLE'),
                
'SCALE'     => $scale,
                
'MODULE'    => 'advertising',
                
'SORT'      => 5000,
                
'COUNTERS'  => array('conversion_visit_day''advertising_banner_click_day'),
                
'CALCULATE' => function(array $counters)
                {
                    
$denominator $counters['conversion_visit_day'] ?: 0;
                    
$numerator   $counters['advertising_banner_click_day'] ?: 0;

                    return array(
                        
'DENOMINATOR' => $denominator,
                        
'NUMERATOR'   => $numerator,
                        
'RATE'        => $denominator $numerator $denominator 0,
                    );
                },
            ),
        );
    }