我正在尝试使用Facebook Marketing API获取数据。
$api = FacebookAds::init('TOKEN');
$start = Carbon::create(2018,11,16);
$end = Carbon::create(2018,11,16);
$period = Period::create($start,$end);
$in = $api->insights($period,'act_ID', 'ad',[
'fields' => ['impressions', 'objective', 'actions'....]
]);
我得到的每个广告都是这样的:
"actions" => array:10 [▼
0 => array:2 [▼
"action_type" => "comment"
"value" => "1"
]
1 => array:2 [▼
"action_type" => "offsite_conversion.fb_pixel_purchase"
"value" => "1"
]
2 => array:2 [▼
"action_type" => "photo_view"
"value" => "114"
]....
]
我的问题是如何获取每个广告目标网址?谢谢
您实际上必须使用AdCreative信息来获取目标网址:https://developers.facebook.com/docs/marketing-api/reference/ad-creative/
我使用object_story_spec并将AdCreative与ad by id匹配(它们共享相同的ID)。