How to set the gender in Facebook Marketing API targetting spec?
I’ve tried setting the gender but i’m getting gender is not a valid target spec field error.
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"}
]
}
]
}
2
Answers
Found it! It should be genders.
The values are:
From https://developers.facebook.com/docs/marketing-api/buying-api/targeting/:
For example: