【发布时间】:2016-08-07 16:54:41
【问题描述】:
我用的是facebook-python-ads-sdk,我关注了官网:
https://developers.facebook.com/docs/marketing-api/tracking-specs#examples
与:
像素跟踪 您可以通过在广告的 tracking_specs 字段中指定跟踪像素来跟踪广告中不同像素的效果。假设您定义:
tracking_specs="[
{'action.type':'offsite_conversion','fb_pixel':1},
{'action.type':'offsite_conversion','fb_pixel':2},
{'action.type':'offsite_conversion','fb_pixel':3}
]"
问题是当我将它添加到广告时,它显示错误为
"error": {
"code": 100,
"is_transient": false,
"error_subcode": 1634019,
"error_user_msg": "Please check that a valid and non-empty object id is passed in.",
"error_user_title": "The id of the object (post, page, etc) passed in is invalid.",
"message": "Invalid parameter",
"type": "FacebookApiException",
"fbtrace_id": "HhCZrs9+8GH"
}
我的代码:
ad = Ad(parent_id=account_id)
ad[Ad.Field.name] = ad_name
ad[Ad.Field.adset_id] = adset_id
ad[Ad.Field.tracking_specs] = {'action.type': 'offsite_conversion', 'fb_pixel': 6029740175958}
当我删除 tracking_specs 时,它可以正常工作。并且我已将像素添加到广告集,它对我来说也可以正常工作。
ad_set[AdSet.Field.promoted_object] = {'pixel_id': 6015522072958}
所以像素id是正确的。
我做错了什么?感谢您的任何回答。
【问题讨论】:
-
这是一组规格,你试过了吗:
ad[Ad.Field.tracking_specs] = [{'action.type': 'offsite_conversion', 'fb_pixel': 6029740175958}] -
@PaulBain 我试过了,但我得到了同样的错误。
标签: python facebook facebook-ads-api facebook-marketing-api