Getting invalid parameter response when creating geo_locations targeting spec in the Facebook Marketing api
Digital Marketing
Facebook Marketing API
2 years ago
5
Star Rating
1
Rating
_x000D_
_x000D_
I am trying to add cities to my geo_location targeting in a facebook marketing api call.
$targeting_spec = array(
'geo_locations' => [
'countries' => ['US'],
'cities' =>
['key' => '2490299','radius' => 10, 'distance_unit' => 'mile']
],
'age_min' => 13,
);
My code above seems like it should be correct, especially after looking at the docs here. However I get the following error:
{"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_subcode":1487079,"is_transient":false,"error_user_title":"Invalid Targeting Spec","error_user_msg":"The specified targeting spec is not valid because: Invalid data for field geo_locations. Invalid Targeting Spec: The specified targeting spec is not valid because: Normalization expecs a KeyedTraversable. TAAL[BLAME_file]\n","fbtrace_id":"HwU9EMDTah1"}}
It seems to be saying there's something invalid about my geo_locations field but I have no idea what that could be. Any ideas? Thank you.
Posted on 16 Aug 2022, this text provides information on Facebook Marketing API related to Digital Marketing. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Take Quiz To Earn Credits!
Turn Your Knowledge into Earnings.