调整dashboard的meta_roas统计口径
This commit is contained in:
parent
c4cfd60c7a
commit
6af935ff23
@ -138,7 +138,7 @@ class AdsDashboardService
|
|||||||
$fieldMapping = [
|
$fieldMapping = [
|
||||||
'meta' => [
|
'meta' => [
|
||||||
'meta_ads' => 'spend', // 示例映射
|
'meta_ads' => 'spend', // 示例映射
|
||||||
'roas' => 'roas',
|
'roas' => 'meta_roas',
|
||||||
'cpc' => 'cpc',
|
'cpc' => 'cpc',
|
||||||
'cpm' => 'cpm',
|
'cpm' => 'cpm',
|
||||||
'meta_purchases' => 'platform_purchase',
|
'meta_purchases' => 'platform_purchase',
|
||||||
@ -221,6 +221,7 @@ class AdsDashboardService
|
|||||||
|
|
||||||
// 计算指标
|
// 计算指标
|
||||||
$roas = ($spend == 0) ? 0 : $revenue / $spend;
|
$roas = ($spend == 0) ? 0 : $revenue / $spend;
|
||||||
|
$meta_roas = ($spend == 0) ? 0 : $platform_purchase_value / $spend;
|
||||||
$google_roas = ($spend == 0) ? 0 : $purchases_value / $spend;
|
$google_roas = ($spend == 0) ? 0 : $purchases_value / $spend;
|
||||||
$ctr = ($impressions == 0) ? 0 : $clicks / $impressions;
|
$ctr = ($impressions == 0) ? 0 : $clicks / $impressions;
|
||||||
$cpoc = ($platform_purchase == 0) ? 0 : $platform_purchase_value / $platform_purchase;
|
$cpoc = ($platform_purchase == 0) ? 0 : $platform_purchase_value / $platform_purchase;
|
||||||
@ -261,6 +262,9 @@ class AdsDashboardService
|
|||||||
case 'roas':
|
case 'roas':
|
||||||
$value = round($roas, 2) . 'x';
|
$value = round($roas, 2) . 'x';
|
||||||
break;
|
break;
|
||||||
|
case 'meta_roas':
|
||||||
|
$value = round($meta_roas, 2) . 'x';
|
||||||
|
break;
|
||||||
case 'google_roas':
|
case 'google_roas':
|
||||||
$value = round($google_roas, 2) . 'x';
|
$value = round($google_roas, 2) . 'x';
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user