2017-10-12 3 views
2

저는 비즈니스 계정과 연결된 Facebook 캠페인의 노출 수, 클릭 수 및 리드를 찾는 관리를 만들고 있습니다. 노출 수와 클릭 수에는 문제가 없었지만 리드를 찾을 수 없습니다. Facebook 패키지에 링크 된 각 광고의 리드를 계산하려고하는 함수의 코드입니다 (Facebook Developer에서 가져옴). 시스템에 의해 인쇄 출력 된 값은 :페이 스북 캠페인 광고의 리드 목록은 항상 비어 있습니다.

SIZE : 0 LIST []

제 경우
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);   
    } 
} 

답변

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(); 
    } 
관련 문제