简体   繁体   English

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

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

I have using the marketing API version 2.6. 我使用的是Marketing API 2.6版。 In 2.5 version we can use the field targeting to retrieve the ads in the Ad Set. 在2.5版本中,我们可以使用字段定位来检索广告集中的广告。 But in 2.6, Field targeting is not supported. 但是在2.6中,不支持字段定位。 I wanna to retrieve the age_min, age_max, geo_locations, and page_types. 我想检索age_min,age_max,geo_locations和page_types。 How to retrieve targeting fields in Ad Set? 如何在广告集中检索定位字段? This is the code i have using to get the fields 这是我用来获取字段的代码

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);

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

I think that "getAds" gets you the ads under the adset. 我认为,“ getAds”可让您在adset下获得广告。 Looks like you are interested in the adset's fields, not the ads under the adset. 您似乎对广告集的字段感兴趣,而不是对广告集下的广告感兴趣。

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

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