使用开放图谱协议将站点与 Facebook 页面链接
我有一个网站 http://www.mydomain.com,它有一个相应的 Facebook 页面 https://www.facebook.com/pages/mydomain/123456789。
我正在寻找一种方法将此 Facebook 页面 URL 集成到开放图标头中,以便当有人共享我的页面时,它实际上共享 Facebook 页面而不是网站的 URL。
这可能吗?
I have a website at http://www.mydomain.com which has a corresponding facebook page at https://www.facebook.com/pages/mydomain/123456789.
I am looking for a way to integrate this facebook page URL into the open graph headers so that when someone shares my page, it actually shares the Facebook page instead of the site's URL.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
现在,您可以通过将
og:url
元标记设置为 Facebook 页面的 URL 来完成此操作。请记住,如果您这样做,使用 Open Graph 标签的其他网络可能会共享您的 Facebook 页面而不是网站的 URL,因此请确保这就是您想要的。You can now do this by setting the
og:url
meta tag to the url of your Facebook page. Keep in mind that if you do this, other networks that use Open Graph tags will probably share your Facebook page instead of the site's url, so make sure that's what you want.也许您已经弄清楚了这一点,因为这是一个老问题,但自从我偶然发现它...如果我正确理解您的问题,您甚至不需要 ogp 元标记来完成您想做的事情。您需要做的就是访问 http://developers.facebook.com/docs/ Reference/plugins/like/ 并在“url to like”中输入您的 Facebook 页面网址,https://www.facebook.com/pages/mydomain/123456789 来自您的示例。然后选择您想要的选项,包括“发送”按钮。然后获取代码并将其粘贴到网站中您想要的位置。现在,每当有人在您的网站上点击“喜欢”或点击“发送”来分享您的网站时,他们实际上会喜欢或将网址发送到您的 Facebook 页面,而不是您的网站。这就是您要找的吗?
Perhaps you already figured this out as this is an old question, but since I stumbled upon it... If I understand your question correctly, you do not even need the ogp meta tags to accomplish what you want to do. All you need to do is go to http://developers.facebook.com/docs/reference/plugins/like/ and input your facebook page url in "url to like", https://www.facebook.com/pages/mydomain/123456789 from your example. Then select the options you want including the "send" button. Then get the code and paste it where you want it in your website. Now whenever someone clicks "like" on your website or clicks "send" to share your website, they will actually be liking or sending the url to your Facebook page and not your website. Is that what you were looking for?