【问题标题】:Geo Targeting Posts in Facebook using Graph API使用 Graph API 在 Facebook 中定位帖子
【发布时间】:2014-02-20 00:16:35
【问题描述】:

我一直在尝试通过 Graph API 在页面上发布以地理位置为目标的状态更新,但目前收效甚微。

使用 Facebook 图形 api,我已经成功地能够定位国家,但不能定位城市或地区。

尝试以下任何一种:

>>> graph.put_object("me", "feed", message="Targeted at Boston", targeting={"countries": 'US', 'cities': 'boston, ma'})                                                                                     
>>> graph.put_object("me", "feed", message="Targeted at Boston", targeting={"countries": 'US', 'cities': ['us, boston, ma']})
>>> graph.put_object("me", "feed", message="Targeted at Boston", targeting=[{'country': 'us', 'city': 'boston', 'region': 'ma'}])
>>> graph.put_object("me", "feed", message="Targeted at Seattle", targeting={"countries": 'US', 'cities': [{'name': 'seattle, wa'}]})
>>> graph.put_object("me", "feed", message="Targeted at Seattle", targeting={"countries": 'US', 'cities': [{'name': 'seattle, wa'}]})

导致发布公开帖子或具有自定义隐私但不针对任何特定位置的帖子。

这个:

>>> graph.put_object("me", "feed", message="Targeted at Seattle", targeting={"countries": 'US'})

致力于选择性地仅针对美国。

我使用Facebook python-sdk 来处理请求。

我一直在尝试多种方法来使定位起作用,但它的文档记录很差,而且 Facebook 开发者论坛上没有太多可用的信息。

有没有人能够传递用于地理定位多个目标的 json ......比如波士顿、马萨诸塞州、巴黎、法国(法语),然后同时传递两者?

【问题讨论】:

标签: python facebook json geotargetting


【解决方案1】:

问题是您需要城市和语言环境键,您可以在此处找到: https://developers.facebook.com/docs/reference/ads-api/get-autocomplete-data/

是的,您可以通过多个城市。

【讨论】:

    【解决方案2】:

    语言环境示例

    curl -F 'access_token=[page_access_token]' 
         -F 'message=Testing post to certain language' 
         -F 'link=http://stackoverflow.com/questions/15280604/can-you-gate-and-target-a-page-post-through-the-facebook-graph-api' 
         -F 'feed_targeting={'locales':[1001]}' 
    https://graph.facebook.com/[pageID]/feed
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-01
      • 2018-04-27
      • 2011-12-01
      • 2018-12-19
      相关资源
      最近更新 更多