如何将不同的产品添加到facebook营销中的产品集广告中?

2024-06-26 00:16:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经完全阅读了动态facebook的文档市场营销。还有已成功创建基于自定义观众和像素的广告事件。但是问题是,每次我创建一个广告,它显示在广告模板相同的产品。你知道吗

下面是设置产品集的代码

    product_set = ProductSet(None, <CATALOG ID>) # <CATALOG ID>
    product_set[ProductSet.Field.name] = 'Product Set'
    product_set[ProductSet.Field.filter] = {
        'product_type': {
            'i_contains': 'example product type',
        },
    }
    product_set.remote_create()
    product_set_id =  product_set[ProductSet.Field.id]

以及设置campaign和adset后创建广告的代码:

    adset = AdSet(parent_id='<ACCOUNT_ID>')
    adset[AdSet.Field.name] = 'Product Adset'
    adset[AdSet.Field.bid_amount] = 9100
    adset[AdSet.Field.billing_event] = AdSet.BillingEvent.link_clicks
    adset[AdSet.Field.optimization_goal] = AdSet.OptimizationGoal.link_clicks
    adset[AdSet.Field.daily_budget] = 45500
    adset[AdSet.Field.campaign_id] = campaign_id
    adset[AdSet.Field.targeting] = {
        Targeting.Field.publisher_platforms: ['facebook', 'audience_network'],
        Targeting.Field.device_platforms: ['desktop','mobile'],
        Targeting.Field.geo_locations: {
            Targeting.Field.countries: ['IN'],
        },
        Targeting.Field.product_audience_specs: [
            {
                'product_set_id': product_set_id,
                'inclusions': [
                    {
                        'retention_seconds': 2592000,
                        'rule': {
                            'event': {
                                'eq': 'ViewContent',
                            },
                        },
                    },
                ],
                'exclusions': [
                    {
                        'retention_seconds': 259200,
                        'rule': {
                            'event': {
                                'eq': 'Purchase',
                            },
                        },
                    },
                ],
            },
        ],
        Targeting.Field.excluded_product_audience_specs: [
            {
                'product_set_id': product_set_id,
                'inclusions': [
                    {
                        'retention_seconds': 259200,
                        'rule': {
                            'event': {
                                'eq': 'ViewContent',
                            },
                        },
                    },
                ],
            },
        ],
    }
    adset[AdSet.Field.promoted_object] = {
        'product_set_id': product_set_id,
    }

    adset.remote_create()
    adset_id = adset[AdSet.Field.id]

你们能帮我从产品集中创建动态产品吗?你知道吗


Tags: eventidfield产品product广告audienceset
1条回答
网友
1楼 · 发布于 2024-06-26 00:16:33

您的产品目录中是否有产品类型包含“示例产品类型”的项目?您可以通过一个api调用来验证/<PRODUCT_SET_ID>?fields=product_count,products所设置的产品下有多少个产品

当广告开始运行时,它会自动呈现产品集中的相关产品。你知道吗

对于creative预览,可以指定要在预览中呈现的特定产品项:例如product_item_ids=["catalog:1000005:MTIzNDU2"]

有关动态广告创意预览的更多详细信息:https://developers.facebook.com/docs/marketing-api/dynamic-product-ads/ads-management/v2.9

相关问题 更多 >