2

我正在创建一个管理,用于查找与我的企业帐户关联的 Facebook 活动的展示次数、点击次数和潜在客户。对于印象和点击,没有问题,但我找不到线索。这是函数的代码(取自 Facebook 开发人员),该函数试图计算链接到 Facebook 活动的每个广告的领先率。System Out 打印的值是:

大小:0,列表:[]

public void getTotalLeads(Campaign campaignFB) throws APIException {

    APINodeList<Ad> ads = campaignFB.getAds().execute();

    for (Ad ad : ads) {

        Ad adFb = new Ad(ad.getId(), context);

        APINodeList<Lead> listLeads = adFb.getLeads().execute(); 

        System.out.println("SIZE: " + listLeads.size());
        System.out.println("LIST: " + listLeads);        
    }
}
4

1 回答 1

0

在我的例子中,广告的形式是:

try {
     final AdAccount account = new AdAccount(ACCOUNT_ID, context);
     final APINodeList<LeadgenForm> forms = account.getLeadGenForms().execute();
     for (final LeadgenForm leadgenForm : forms) {
        System.out.println(leadgenForm.getId());
        final APINodeList<Lead> leads = leadgenForm.getLeads().execute();
        for (final Lead lead : leads) {
           System.out.println(lead.getFieldFieldData());
        }
     }
  }
  catch (final APIException e) {
     e.printStackTrace();
  }
于 2018-01-29T16:32:39.640 回答