谷歌+ +1 按钮片段+问题
我已将 Google +1 按钮集成到网站中 ( http://www2.highpoint.edu )。
我尝试使用 schema.org 标签为 +Snippets 信息提供名称、描述和图像,但它不起作用。
当我使用 +1 按钮并尝试向 Google+ 发布有关该网站的信息时,它选择了我不想要的图像。它不会选择我使用 标记设置的图像。
我的问题:
- 如何获取从 schema.org 元数据填充的 +Snippet 数据?
- 对于包含 2 个或更多 +1 按钮的页面,我可以为每个 +1 按钮使用不同的名称/描述/图像吗?或者页面上的每个 +1 按钮都必须使用相同的元数据吗?
编辑
我认为最好使用开放图协议而不是 schema.org。也就是说,根本不应该使用 schema.org。 Facebook 支持 Open Graph 协议,因此您可以用这种方式一石二鸟。
更重要的是,Facebook 提供了一个很棒的调试工具,可以告诉您给定 URL 到底解析了什么内容: http:// /developers.facebook.com/tools/debug
我仍然不确定同一页面上是否有多个 +1 按钮,每个 +1 按钮具有明显不同的元数据。
I have integrated the Google +1 button into a website ( http://www2.highpoint.edu ).
I tried to use schema.org <meta>
tags to provide Name, Description, and Image for the +Snippets information, but it doesn't work.
When I use the +1 button and try to post to Google+ about the website, it picks an image that I don't want. And it won't pick the image I have set with the <meta>
tag.
My questions:
- How do I get the +Snippet data populated from schema.org metadata?
- For a page with 2 or more +1 buttons, can I have different name/description/image for each +1 button? Or must every +1 button on the page use the same metadata?
EDIT
I think it is best to use Open Graph Protocol instead of schema.org. That is, schema.org shouldn't be used at all. Facebook supports Open Graph Protocol, so you can kill 2 birds with 1 stone this way.
More importantly, Facebook provides a great debugging tool that tells you what exactly is getting parsed for a given URL: http://developers.facebook.com/tools/debug
I am still not sure about having multiple +1 buttons on the same page with each +1 button having distinctly different meta data.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
针对问题1:
我检查了您的页面。看起来您有一个正常的元标题和描述。这应该适用于 +1 按钮,但 +1 按钮可能需要一些时间才能接受您所做的更改。
不过,如果您想控制图像,则需要使用 schema.org 标记或打开图表,如官方常见问题解答中所述:http://code.google.com/apis/+1button/#plus-snippet
对于问题 2:
如果您使用的是 schema.org 标记,则+1按钮将读取内容最靠近页面源代码顶部的 itemscope。
In response to question 1:
I checked your page. It looks like you have a normal meta title and description. This should work for the +1 button, but it may take some time for the +1 button to pick up the changes you've made.
If you'd like control of the image, though, you will need to use schema.org markup or open graph as described in the official FAQ: http://code.google.com/apis/+1button/#plus-snippet
And for question 2:
If you are using schema.org markup, the +1 button will read the content for the itemscope nearest the top of the page's source code.
它对我也不起作用。我的网页中有 Schema.org 和 Open Graph(例如 http://r.mycrep.net/ 3Nkh/),多个验证器(Facebook 和其他验证器)正确读取信息。
我猜谷歌仍然不支持每个人的元数据:-(
It does not work for me either. I have both Schema.org and Open Graph in the web page (eg. http://r.mycrep.net/3Nkh/), Multiple validators (Facebook's and one other) read info correctly.
I guess that Google still does not support metadata for everybody :-(