2017-06-23 163 views
1

我正在通過發佈到adsets端點(市場營銷API)來創建廣告。 它返回我下面的錯誤:Facebook Adset創建在傳送帶廣告上失敗廣告素材

{ 
    "error": { 
    "message": "An unknown error occurred", 
    "type": "OAuthException", 
    "code": 1, 
    "error_subcode": 1815652, 
    "is_transient": false, 
    "error_user_title": "Missing Messenger Destination in Child Item", 
    "error_user_msg": "To use Messenger as destination, all children  items in the carousel ads should have messenger destination.", 
    "fbtrace_id": "AdulKVKescc" 
    } 
} 

創意是轉盤。 每個轉盤的兒童(卡)已經得到了妥善call_to_action,這是'{type:"LEARN_MORE",value:{app_destination:"MESSENGER"}}'

我試圖把link,而不是投入的子元素link的各種組合。我也嘗試過放置m.me鏈接,但在創建廣告素材時會引發不同的錯誤。

我使用adcreatives端點創建我的廣告...

上應該是什麼樣的鏈接值是任何指引? Facebook文件稱它被忽略。如果忽略,爲什麼錯誤?

回答

2

該錯誤有點讓人誤解,因爲child_attachments都包含call_to_action,但您還必須將相同的call_to_action添加到link_data或video_data中的廣告素材(具體取決於廣告素材的類型)。

0

將call_to_action添加到link_data。 信用克里斯·西蒙斯

# use picture or image_hash 
fb_dummy_image = 'https://i.ytimg.com/vi/eGKWS6_187s/maxresdefault.jpg' 
image_hash = "164d943385c130d64e702664c9ab1798" 

data = { 
    "access_token": SELLIO_AD_SERVER_TOKEN, 
    "name": "Sample Creative", 
    "object_story_spec": { 
     "link_data": { 
     "call_to_action": {"type": "LEARN_MORE", "value": {"app_destination": "MESSENGER"}}, 
      "child_attachments": [ 
       { 
        "description": "$800.99", 
        "image_hash": image_hash, 
        "link": "https://www.example.com", 
        "name": "A1", 
        "call_to_action": { 
         "type": "LEARN_MORE", 
         "value": { 
          "app_destination": "MESSENGER", 
         } 
        }, 
       }, 
       { 
        "description": "$400.99", 
        "image_hash": image_hash, 
        "link": "https://www.example.com", 
        "name": "A2", 
        "call_to_action": { 
         "type": "LEARN_MORE", 
         "value": { 
          "app_destination": "MESSENGER", 
         } 
        }, 
       }, 
       { 
        "description": "$300.99", 
        "picture": fb_dummy_image, 
        "link": "https://www.messenger.com/t/xxxxxxxxxxxx", 
        "name": "A3", 
        "call_to_action": { 
         "type": "LEARN_MORE", 
         "value": { 
          "app_destination": "MESSENGER", 
         } 
        } 
       } 
      ], 
      "link": "https://www.messenger.com/t/xxxxxxxxxx", 
      "page_welcome_message": '{"user_edit": true, "message": {"attachment": {"type": "template", "payload": {"template_type": "generic", "elements": [{"buttons": [{"url": "http://www.example.com/", "type": "web_url", "title": "View Website"}, {"type": "postback", "payload": "USER_DEFINED_PAYLOAD", "title": "Start Chatting"}], "subtitle": "Optional: Enter a subtitle to provide more information", "image_url": "https://image.ibb.co/bz5t6Q/placeholder.png", "title": "Enter a title to accompany your image"}, {"buttons": [{"url": "http://www.example.com/", "type": "web_url", "title": "View Website"}, {"type": "postback", "payload": "USER_DEFINED_PAYLOAD", "title": "Start Chatting"}], "subtitle": "2nd product", "image_url": "https://image.ibb.co/bz5t6Q/placeholder.png", "title": "a2"}, {"buttons": [{"url": "http://www.example.com/", "type": "web_url", "title": "View Website"}, {"type": "postback", "payload": "USER_DEFINED_PAYLOAD", "title": "Start Chatting"}], "subtitle": "3rd product", "image_url": "https://image.ibb.co/bz5t6Q/placeholder.png", "title": "a3"}]}}}}' 
     }, 
     "page_id": "xxxxxxxxxxx" 
    } 
} 

然後也使與留言爲目標

def create_campaign(ad_account_id, campaign_name): 
my_account = AdAccount(ad_account_id) 
campaign = Campaign(parent_id=my_account.get_id_assured()) 

campaign.update({ 
    Campaign.Field.name: campaign_name, 
    Campaign.Field.objective: 'MESSAGES' 
}) 

campaign.remote_create(params={ 
    'status': Campaign.Status.paused, 
}) 
logging.debug(campaign) 
return campaign.get_id() 
廣告活動
相關問題