Geotargeting Page Posts with the Facebook API

后端 未结 2 2039
情话喂你
情话喂你 2021-01-06 06:31

I\'m trying to geotarget wall posts to my fan page using the Facebook PHP SDK.

The following snippet successfully posts a message to my wall, but the geotargeting is

相关标签:
2条回答
  • 2021-01-06 07:15

    The field is privacy in the Post table

    The description field may contain a comma-separated lists of valid country, city and language if a Page's post targeting by location/language is specified.

    http://developers.facebook.com/docs/reference/api/post/

    0 讨论(0)
  • 2021-01-06 07:30

    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 regions too. http://developers.facebook.com/docs/reference/ads-api/get-autocomplete-data/

    What you need to complete the targeting in the question would be:

    The countries bit was right. Virginia's region code is 51 (which you can find by searching _">https://graph.facebook.com/search?q=vi&type=adregion&match_country_code=true&country_list=US&access_token=_) Richmond's city id is 2538983 (which you can find by searching _">https://graph.facebook.com/search?q=richmon&type=adcity&limit=150&access_token=_)

    so the geotarget would be

    $geoTarget = "{'cities':[2538983],'regions':[51],'countries':'US'}";
    
    0 讨论(0)
提交回复
热议问题