需要帮助使用 Meta API 创建具有展示位置自定义的轮播广告素材

问题描述 投票:0回答:1

我目前正在致力于集成 Meta API 以在 Facebook 上创建广告。我专门尝试创建具有展示位置自定义的轮播广告素材,但我在实施方面面临一些挑战。

我参考了Meta API的官方文档,特别是创意和投放资源定制部分。然而,尽管遵循了提供的指南,我仍无法使用自定义资源创建成功的轮播广告素材。

我非常感谢任何能够帮助我理解使用 Meta API 创建具有展示位置自定义的轮播广告素材的请求的正确结构的指导、见解或代码示例。具体来说,我想知道如何正确构建 asset_feed_spec、carousel 和 asset_customization_rules 部分。

预先感谢您的协助!

我已经尝试成功实现单图像格式的自定义,但是当我尝试将其扩展为轮播格式时,问题出现了。我已经查看了文档(https://developers.facebook.com/docs/marketing-api/ad-creative/asset-feed-spec/options/),但我仍然无法找出正确的结构API 请求。

为了提供一些背景信息,这是我发送的请求的示例:

{
        "asset_feed_spec": {
            "images": [
                {
                    "adlabels": [
                        {
                            "name": "image_0"
                        }
                    ],
                    "hash": "73ba9fe21d08f6551a6879d072819328"
                },
                {
                    "adlabels": [
                        {
                            "name": "image_1"
                        }
                    ],
                    "hash": "0ffd928a1f2a9994ab5268b5985cd8a2"
                },
                {
                    "adlabels": [
                        {
                            "name": "image_2"
                        }
                    ],
                    "hash": "bbe5de998919998a24e038fe88dfdfba"
                },
                {
                    "adlabels": [
                        {
                            "name": "image_3"
                        }
                    ],
                    "hash": "1fd1162115b422551e44061895212287"
                }
            ],
            "bodies": [
                {
                    "adlabels": [
                        {
                            "name": "body_0"
                        }
                    ],
                    "text": ""
                }
            ],
            "call_to_action_types": [
                "LEARN_MORE"
            ],
            "descriptions": [
                {
                    "adlabels": [
                        {
                            "name": "description_0"
                        }
                    ],
                    "text": ""
                },
                {
                    "adlabels": [
                        {
                            "name": "description_1"
                        }
                    ],
                    "text": "Action"
                }
            ],
            "link_urls": [
                {
                    "adlabels": [
                        {
                            "name": "link_0"
                        }
                    ],
                    "website_url": "https://test.com/",
                    "display_url": ""
                },
                {
                    "adlabels": [
                        {
                            "name": "link_1"
                        }
                    ],
                    "website_url": "https://test.com/"
                }
            ],
            "titles": [
                {
                    "adlabels": [
                        {
                            "name": "title_0"
                        }
                    ],
                    "text": ""
                }
            ],
            "carousels":[
                {
                    "multi_share_end_card": false,
                    "multi_share_optimized": false,
                    "adlabels": [
                        {
                            "name": "CAROUSEL_0"
                        }
                    ],
                    "child_attachments": [
                        {
                            "image_label": {
                                "name": "image_0"
                            },
                            "title_label":{
                                 "name": "title_0"
                            },
                            "description_label":{
                                "name": "description_0"
                           },
                           "link_url_label":{
                            "name": "link_0"
                           }
                        },
                        {
                            "image_label": {
                                "name": "image_1"
                            },
                            "title_label":{
                                 "name": "title_0"
                            },
                            "description_label":{
                                "name": "description_0"
                           },
                           "link_url_label":{
                            "name": "link_0"
                           }
                        },
                        {
                            "image_label": {
                                "name": "image_2"
                            },
                            "title_label":{
                                 "name": "title_0"
                            },
                            "description_label":{
                                "name": "description_0"
                           },
                           "link_url_label":{
                            "name": "link_0"
                           }
                        },
                        {
                            "image_label": {
                                "name": "image_3"
                            },
                            "title_label":{
                                 "name": "title_0"
                            },
                            "description_label":{
                                "name": "description_0"
                           },
                           "link_url_label":{
                            "name": "link_0"
                           }
                        }
                    ]
                },
                {
                    "multi_share_end_card": false,
                    "multi_share_optimized": false,
                    "adlabels": [
                        {
                            "name": "CAROUSEL_1"
                        }
                    ],
                    "child_attachments": [
                         {
                            "image_label": {
                                "name": "image_0"
                            },
                            "title_label":{
                                 "name": "title_0"
                            },
                            "description_label":{
                                "name": "description_1"
                           },
                           "link_url_label":{
                            "name": "link_1"
                           }
                        },
                        {
                            "image_label": {
                                "name": "image_1"
                            },
                            "title_label":{
                                 "name": "title_0"
                            },
                            "description_label":{
                                "name": "description_1"
                           },
                           "link_url_label":{
                            "name": "link_1"
                           }
                        },
                        {
                            "image_label": {
                                "name": "image_2"
                            },
                            "title_label":{
                                 "name": "title_0"
                            },
                            "description_label":{
                                "name": "description_1"
                           },
                           "link_url_label":{
                            "name": "link_1"
                           }
                        },
                        {
                            "image_label": {
                                "name": "image_3"
                            },
                            "title_label":{
                                 "name": "title_0"
                            },
                            "description_label":{
                                "name": "description_1"
                           },
                           "link_url_label":{
                            "name": "link_1"
                           }
                        }
                    ]
                }
            ],
            "ad_formats": [
                "CAROUSEL_IMAGE"
            ],
            "asset_customization_rules": [
                {
                    "customization_spec": {
                        "age_max": 65,
                        "age_min": 13,
                        "publisher_platforms": [
                            "instagram"
                        ],
                        "instagram_positions": [
                            "stream"
                        ]
                    },
                    "carousel_label": {
                        "name": "CAROUSEL_0"
                    },
                    "priority": 1
                },
                {
                    "customization_spec": {
                        "age_max": 65,
                        "age_min": 13
                    },
                    "carousel_label": {
                        "name": "CAROUSEL_1"
                    },
                    "priority": 2
                }
            ],
            "optimization_type": "PLACEMENT",
            "additional_data": {
                "multi_share_end_card": false,
                "is_click_to_message": false
            }
        },
        "object_story_spec": {
            "page_id": "112232461886043",
            "instagram_actor_id": "9058173320920337"
        },
        "degrees_of_freedom_spec": {
            "creative_features_spec": {
                 "standard_enhancements": {
                 "enroll_status": "OPT_IN"
              }
             }
            },
        "use_page_actor_override": false
}

但是,我收到一条错误消息,指示当前的广告产品不支持轮播格式。我已经验证了广告产品的兼容性并查看了文档,但我一直无法找到解决方案。

facebook facebook-graph-api facebook-javascript-sdk facebook-opengraph
1个回答
0
投票

我一直在更新当前的代码以符合 API v17,并且在轮播广告中遇到了相同的“不支持的格式”错误。

FB carousel unsupported format error

在研究此 api 版本引入的Advantage+ Creative 的标准增强更改后,我发现在该页面的“限制”部分中详细说明了不支持轮播广告。

因此,在示例代码中,您需要设置以下部分来设置标准增强功能

"degrees_of_freedom_spec": {
        "creative_features_spec": {
             "standard_enhancements": {
             "enroll_status": "OPT_OUT"
         }}}

即 OPT_OUT 而非 OPT_IN

测试了广告的这一更改后,我看到了错误,现在它再次运行。

© www.soinside.com 2019 - 2024. All rights reserved.