85 if($dateFrom && $dateTo)
87 $params[
'period'] =
'day';
88 $params[
'date_from'] = $dateFrom->format(
'Y-m-d');
89 $params[
'date_to'] = $dateTo->format(
'Y-m-d');
93 $params[
'period'] =
'summary';
94 $params[
'date_from'] =
'0';
95 $params[
'date_to'] =
'0';
98 'methodName' =>
'analytics.expenses.get',
99 'parameters' => $params,
101 if($response->isSuccess())
103 $data = $response->getData();
106 'impressions' => $data[
'shows'],
107 'clicks' => $data[
'clicks'],
108 'actions' => $data[
'clicks'],
109 'spend' => $data[
'spent'],
110 'currency' => static::CURRENCY_CODE,
112 $result->setData([
'expenses' => $expenses]);
116 $result->addErrors($response->getErrors());