Facebook Marketing API见解(目标URL)

时间:2018-11-20 13:20:19

标签: laravel facebook-graph-api facebook-marketing-api facebook-insights

我正在尝试使用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"
       ]....
    ]

我的问题是如何获取每个广告目标网址? 谢谢

1 个答案:

答案 0 :(得分:0)

您实际上必须使用AdCreative信息来获取目标网址:https://developers.facebook.com/docs/marketing-api/reference/ad-creative/

我使用object_story_spec并通过ID将AdCreative与广告匹配(它们共享相同的ID)。