猿问

Facebook Marketing API 获取活动信息

我正在使用 facebook 自动生成的代码尝试连接到营销 API 以获取活动统计信息。这样做,我得到:


Uncaught FacebookAds\Http\Exception\AuthorizationException: (#100) results, actions:like, video_play_actions:video_view, video_avg_time_watched_actions:video_view, unique_actions:link_click 对字段参数无效。


$fields = array(

  'results',

  'reach',

  'actions:like',

  'video_play_actions:video_view',

  'video_avg_time_watched_actions:video_view',

  'unique_actions:link_click',

);

var_dump($fields);

$params = array(

  'level' => 'campaign',               

  'filtering' => array(array('field' => 'campaign.delivery_info','operator' => 'IN','value' => array('active'))),

  'breakdowns' => array(),

  'time_range' => array('since' => '2017-05-19','until' => '2019-05-19'),

);

echo json_encode((new AdAccount($ad_account_id))->getInsights(

  $fields,

  $params

)->getResponse()->getContent(), JSON_PRETTY_PRINT);

上面我使用了campaign.delivery_info per this answer。我也试过(根据自动生成的代码):


'filtering' => array(array('field' => 'delivery_info','operator' => 'IN','value' => array('active')))



烙印99
浏览 135回答 1
1回答

aluckdog

似乎您要求旧值字段,试试这个:$fields = array(  'reach',  'actions',  'video_play_actions',  'video_avg_time_watched_actions',  'outbound_clicks',);希望这有帮助注意:results字段不可用
随时随地看视频慕课网APP
我要回答