如何通过 Graph API 指定 FB 帖子的位置定位
不久前,Post API 中有一个名为 targeting
的字段参考,但现在它已经消失了,我不知道如何通过 API 将特定位置和语言定位添加到帖子中。我搜索了很多:一些结果引用了 targeting
参数。我已经尝试过,但似乎不起作用。
我尝试了两种方法来实现这一目标,但没有成功:
$post_details = array('message' => $msg, 'privary' => array('value' => 'CUSTOM', 'description' => array('country' => 'Germany')));
$fb->api('/PAGE_ID/feed', 'POST', $post_details);
请
$post_details = array('message' => $msg, 'targeting' => array('country' => 'Germany'));
$fb->api('/PAGE_ID/feed', 'POST', $post_details);
帮助我了解如何实现这一目标?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
除了
privacy
,您还可以使用feed_targeting
您可以定位的所有参数(例如语言、城市、县)都是 Facebook 特定的。您可以通过自动完成数据来解决它们:
“{'locales':[1001],'countries':[GE],'cities':[825886]}”
自动发布目标的不错功能,但Facebook文档中记录得很差...
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...
如需定位,请参阅帖子对象的
privacy
属性:https ://developers.facebook.com/docs/reference/api/post/for targeting, see the
privacy
property of the post object: https://developers.facebook.com/docs/reference/api/post/为了使这更容易,这就是您需要的http://developers.facebook .com/docs/reference/api/page/#targeting
这也将提供有关如何定位城市的信息。 http://developers.facebook.com/docs/reference /ads-api/get-autocomplete-data/
我对这个问题的更完整的解决方案使用 Facebook API 对页面帖子进行地理定位
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