我的页面上有一个Google+和Facebook的点赞按钮。我从他们那里得到了所需的脚本,并动态地设置了数据属性。但当我点击“分享”按钮或“喜欢”按钮时,它会打开一个随机的图片和标题。我有他们的元标签来识别标题,图片和描述,我想使用,但不知何故,他们没有拿起元标签。
以下是来自Facebook开发人员调试工具的错误
fb:admins and fb:app_id tags are missing. These tags are necessary for Facebook to render a News Feed story that generates a high click-through rate.
og:title is missing. The og:title meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate.
og:type is missing. The og:type meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate.
og:image is missing. The og:image meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate.HTML中呈现的Meta标签
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://opengraphprotocol.org/schema/"
itemscope itemtype="http://schema.org/Product">
<meta content="No appointment necessary. We hear you coming" name="og:title">
<meta content="http://www.mysite.com" name="og:site_name">
<meta content="blog" name="og:type">
<meta content="http://www.mysite.com/entries/viewentry.aspx" name="og:url">
<meta content="http://static.mysite.com/Images/imag21.jpg" name="og:image">
<meta content="447438772019226" name="fb:app_id">
<meta content="Temp title and some descriptions" name="description">Facebook脚本
<div class="facebookShare">
<div class="fb-like" data-font="verdana" data-href=
'<%= currentPageURL.Value %>' data-layout="box_count" data-send="true"
data-show-faces="true" data-width="500"></div>
</div>
// currentPageURL is a hidden field which sets the URL fine.
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));Google+共享按钮脚本
<div class="googlePlusShare col span_1_of_12">
<!-- Place this tag where you want the share button to render. -->
<div class="g-plus" data-action="share" data-annotation=
"vertical-bubble" data-height="60" data-href='<%= currentPageURL.Value %>'</div>
</div>
(function() {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();为两者呈现的HTML
<div class="fb-like fb_edge_widget_with_comment fb_iframe_widget"
data-font="verdana" data-href="http://www.mysite.com/viewentry.aspx?entryId=6"
data-layout="box_count" data-send="false" data-show-faces="true"
data-width="500">
</div>// Google+还替换了整个html和我的data-href属性,并在其中添加了一些代码,我在其中看不到当前页面的URL。至少我可以在facebook的标签中看到这一点
然而,当点击时,两者都不会拉出我的meta标签信息。请帮帮忙。
发布于 2013-10-27 21:42:01
试着把你的网址加载到:http://www.google.com/webmasters/tools/richsnippets,它会告诉你你的网址是否对谷歌可见。它还会告诉您标记中是否有任何错误。
https://stackoverflow.com/questions/17361040
复制相似问题