0

在業務經理上,每一個Facebook Lead Ad都與一個leadgen表單關聯(每當我創建一個廣告時,我也會爲其製作一個新表單)。因此,應該可以檢索附加到廣告的leadgen表單。是否可以從Ad對象獲取leadgen表單(與廣告相關聯)?

我知道我可以通過圖表鏈接和頁面令牌獲取所有鉛表格,但這還不夠,因爲沒有辦法找出哪個表格連接到哪個廣告。

這就是說,這裏是我獲得可以通過在廣告客戶查詢信息的響應:

[data:protected] => Array 
    (
     [account_id] => 
     [ad_review_feedback] => 
     [adlabels] => 
     [adset] => Array 
      (
       [id] => 123123123123123 
      ) 

     [adset_id] => 123123123123123 
     [bid_amount] => 
     [bid_info] => 
     [bid_type] => ABSOLUTE_OCPM 
     [campaign] => Array 
      (
       [id] => 123123123123123 
      ) 

     [campaign_id] => 123123123123123 
     [configured_status] => ACTIVE 
     [conversion_specs] => Array 
      (
       [0] => Array 
        (
         [action.type] => Array 
          (
           [0] => leadgen 
          ) 

         [leadgen] => Array 
          (
           [0] => 123123123123442 
          ) 

        ) 

      ) 

     [created_time] => 2017-04-10T16:40:00-0400 
     [creative] => Array 
      (
       [id] => 123123123123123 
      ) 

     [effective_status] => CAMPAIGN_PAUSED 
     [id] => 12312312312312312 
     [last_updated_by_app_id] => 123123123123123 
     [name] => My Ad 
     [recommendations] => Array 
      (
       [0] => Array 
        (
         [title] => Creative Is Not Eligible For Instagram 
         [message] => Creative is not eligible for Instagram. Your ad will still be eligible to show in other placements. Instagram feed video duration can not be longer than 60 seconds. 
         [code] => 1942020 
         [importance] => HIGH 
         [confidence] => HIGH 
         [blame_field] => creative 
        ) 

      ) 

     [status] => ACTIVE 
     [tracking_specs] => Array 
      (
       [0] => Array 
        (
         [action.type] => Array 
          (
           [0] => post_engagement 
          ) 

         [page] => Array 
          (
           [0] => 123123123123123 
          ) 

         [post] => Array 
          (
           [0] => 123123123123123 
          ) 

        ) 

       [1] => Array 
        (
         [action.type] => Array 
          (
           [0] => link_click 
          ) 

         [post] => Array 
          (
           [0] => 123123123123123 
          ) 

         [post.wall] => Array 
          (
           [0] => 123123123123123 
          ) 

        ) 

      ) 

     [updated_time] => 2017-04-10T16:40:53-0400 
     [date_format] => 
     [display_sequence] => 0 
     [execution_options] => 
     [redownload] => 
     [filename] => 
    ) 

這是我的廣告對象,從我可以得到很多東西,廣告內容,廣告客戶,廣告系列,Adset等......如果我能從其中某個地方獲得leadgen表單鏈接或ID,那將是非常棒的!

讓我困惑的事情最多的是我認爲上述響應中的leadgen數組是我需要的表單ID,但它似乎對於我查詢的每個廣告對象都是相同的ID,而且我甚至沒有知道什麼是ID(不是表單ID)。

任何和所有的幫助表示讚賞。

UPDATE:

雖然挖通過Facebook尋找的東西無關,我碰到這樣的:

$ad = new Ad(<AD_ID>); 
$leads = $ad->getLeads(); 

所以我想,下面的工作:

// My Ad Object 
    $ads = $account->getAds(array(
     AdFields::AD_REVIEW_FEEDBACK, 
     AdFields::ADLABELS, 
     AdFields::ADSET, 
     AdFields::ADSET_ID, 
     AdFields::BID_AMOUNT, 
     AdFields::BID_INFO, 
     AdFields::BID_TYPE, 
     AdFields::CAMPAIGN, 
     AdFields::CAMPAIGN_ID, 
     AdFields::CONFIGURED_STATUS, 
     AdFields::CONVERSION_SPECS, 
     AdFields::CREATED_TIME, 
     AdFields::CREATIVE, 
     AdFields::EFFECTIVE_STATUS, 
     AdFields::LAST_UPDATED_BY_APP_ID, 
     AdFields::NAME, 
     AdFields::RECOMMENDATIONS, 
     AdFields::STATUS, 
     AdFields::TRACKING_SPECS, 
     AdFields::UPDATED_TIME, 
     AdFields::DATE_FORMAT, 
     AdFields::DISPLAY_SEQUENCE, 
     AdFields::EXECUTION_OPTIONS, 
     AdFields::REDOWNLOAD, 
     AdFields::FILENAME 
     )); 

    foreach ($ads as $ad) { 
     print_r($ad->getLeads(array(
      LeadFields::AD_ID, 
      LeadFields::AD_NAME, 
      LeadFields::ADSET_ID, 
      LeadFields::ADSET_NAME, 
      LeadFields::CAMPAIGN_ID, 
      LeadFields::CAMPAIGN_NAME, 
      LeadFields::CREATED_TIME, 
      LeadFields::CUSTOM_DISCLAIMER_RESPONSES, 
      LeadFields::FIELD_DATA, 
      LeadFields::FORM_ID, 
      LeadFields::ID, 
      LeadFields::IS_ORGANIC, 
      LeadFields::POST 
      ))); 

然而,我在那裏獲得了每個廣告字段,但是我沒有收到來自潛在客戶的任何字段

回答

0

似乎今天沒有辦法從廣告中獲得鉛字形式,除了我上面提到的getLeads()方法;它可以很好地工作,除非它只在該表單上有線索時纔會返回。如果沒有任何潛在客戶(如果活動尚未啓動等情況通常不存在)......目前沒有辦法找出通過API與廣告相關聯的形式。

相關問題