我无法从API(特别是Python API)找到任何文档或其他有关如何执行此操作的示例。所有文档均涉及通过Power Editor或广告管理器上传自定义受众.csv。还有其他人遇到吗?
最佳答案
https://developers.facebook.com/docs/marketing-api/reference/custom-audience
https://developers.facebook.com/docs/marketing-api/reference/custom-audience/users/
from facebookads.objects import CustomAudience
audience = CustomAudience(parent_id='act_<AD_ACCOUNT_ID>')
audience[CustomAudience.Field.subtype] = CustomAudience.Subtype.custom
audience[CustomAudience.Field.name] = 'My new CA'
audience[CustomAudience.Field.description] = 'People who bought on my website'
audience.remote_create()
然后:
from facebookads.objects import CustomAudience
audience = CustomAudience('<CUSTOM_AUDIENCE_ID>')
users = ['[email protected]', '[email protected]', '[email protected]']
audience.add_users(CustomAudience.Schema.email_hash, users)
关于python - FaceBook Marketing API是否公开了自定义受众群体的创建?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36062512/