繁体   English   中英

在Facebook Marketing API中读取具有定位条件的广告集字段

[英]Reading Ad set fields with targeting in Facebook marketing API

我使用的是Marketing API 2.6版。 在2.5版本中,我们可以使用字段定位来检索广告集中的广告。 但是在2.6中,不支持字段定位。 我想检索age_min,age_max,geo_locations和page_types。 如何在广告集中检索定位字段? 这是我用来获取字段的代码

if(is_null(ACCESS_TOKEN) || is_null(APP_ID) || is_null(APP_SECRET)) {
      throw new \Exception(
        'You must set your access token, app id and app secret before executing'
      );
    }
    if (is_null(ACCOUNT_ID)) {
      throw new \Exception(
        'You must set your account id before executing');
    }
    Api::init(APP_ID, APP_SECRET, ACCESS_TOKEN);
    $adSet      = new AdSet($adSetId);
    $fields     = array('name', 'targeting', 'creative', 'conversion_specs', 'redownload', 'genders', 'tracking_specs');
    $result     = $adSet->getAds($fields, $limit);

也许$ result = $ adSet-> read($ fields); 应该管用?

我认为,“ getAds”可让您在adset下获得广告。 您似乎对广告集的字段感兴趣,而不是对广告集下的广告感兴趣。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM