Some time ago there was a field called targeting
in the Post API Reference but now it's gone and I don't know how to add a specific location and language targeting to the post via API. I've search a lot: some results refer to the targeting
parameter. I've tried it, but it seems don't working.
I've tried 2 ways to achieve this, but without any success:
$post_details = array('message' => $msg, 'privary' => array('value' => 'CUSTOM', 'description' => array('country' => 'Germany')));
$fb->api('/PAGE_ID/feed', 'POST', $post_details);
and
$post_details = array('message' => $msg, 'targeting' => array('country' => 'Germany'));
$fb->api('/PAGE_ID/feed', 'POST', $post_details);
Please help me understand how can I achieve this?
for targeting, see the
privacy
property of the post object: https://developers.facebook.com/docs/reference/api/post/To make this easier this is the bit you need http://developers.facebook.com/docs/reference/api/page/#targeting
this will give the info on how to target cities too. http://developers.facebook.com/docs/reference/ads-api/get-autocomplete-data/
a more complete solution from me on this question Geotargeting Page Posts with the Facebook API
instead of
privacy
you also can usefeed_targeting
All parameters which you can target like languages,cities,counties are facebook specific. You can resolve them via autocomplete data :
"{'locales':[1001],'countries':[GE],'cities':[825886]}"
Nice feature for automatic posting with targeting but so bad documented in the Facebook documentation...