facebook - 在targeting_spec上按性别过滤
问题描述
如何在 Facebook Marketing API 定位规范中设置性别?
我尝试设置性别,但我得到的性别不是有效的目标规范字段错误。
targeting_spec = {"geo_locations":
{
"location_types": ["recent"],
"custom_locations": [
{
"latitude": 14.5764,
"longitude": 121.0851,
"radius": 17
}
]
},
"age_min": 18,
"age_max": 35,
"gender": "male", // Setting gender, doesn't work
"flexible_spec": [
{
"interests": [
{"id": "6002998074973", "name": "BTS"}
]
},
{
"interests": [
{"id": "6005882720291", "name": "Data Science"}
]
}
]
}
解决方案
来自https://developers.facebook.com/docs/marketing-api/buying-api/targeting/:
性别:数组
- 1=男性
- 2=女性。
- 默认为所有。
例如:
targeting: {
genders: [1]
...
推荐阅读
- python - 使用 Python 和 Scrapy 进行站点审计
- asp.net-mvc - TinyMCE 5.7.0 - 无法读取未定义的属性“isTouch”
- c - 在 C 语言中将字符串转换为简单的单字符值
- svelte - Svelte 如何在每个循环中处理更新数组中的对象
- loopbackjs - Loopback 4 cli 指令语言 - 如何重置
- grep - 如何使用 grep 匹配文件?
- php - 如何将 Droplet 与 PhpStorm 连接
- tailwind-css - 变体悬停在 TailwindCss 中不适用
- spring-boot - 未使用 @MapsId 找到父键
- android - 我正在 Glide 中加载图像,但如果 url 包含空格,Glide 将无法工作