如何通过 Graph API 指定 FB 帖子的位置定位

发布于 2024-12-22 17:16:20 字数 703 浏览 1 评论 0原文

不久前,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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

筱武穆 2024-12-29 17:16:20

除了 privacy,您还可以使用 feed_targeting

您可以定位的所有参数(例如语言、城市、县)都是 Facebook 特定的。您可以通过自动完成数据来解决它们:

“{'locales':[1001],'countries':[GE],'cities':[825886]}”

自动发布目标的不错功能,但Facebook文档中记录得很差...

instead of privacy you also can use feed_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...

凉风有信 2024-12-29 17:16:20

如需定位,请参阅帖子对象的 privacy 属性:https ://developers.facebook.com/docs/reference/api/post/

描述字段可能包含逗号分隔的有效列表
国家、城市和语言(如果主页的帖子定位为
指定位置/语言。

注意:此隐私设置仅适用于当前或当前的帖子
指定用户自己的墙。 Facebook 会忽略此设置以进行定向
墙上的帖子(当用户在朋友主页的墙上写字时,
事件、连接到用户的组)。与行为一致
Facebook,所有有针对性的帖子都可以被任何可以看到的人查看
目标的墙。

for targeting, see the privacy property of the post object: https://developers.facebook.com/docs/reference/api/post/

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.

Note: This privacy setting only applies to posts to the current or
specified user's own Wall. Facebook ignores this setting for targeted
Wall posts (when the user is writing on the Wall of a friend, Page,
event, group connected to the user). Consistent with behavior on
Facebook, all targeted posts are viewable by anyone who can see the
target's Wall.

薄凉少年不暖心 2024-12-29 17:16:20

为了使这更容易,这就是您需要的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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文