Facebook,谷歌+分享按钮无法识别我的元标记

时间:2013-06-28 09:04:34

标签: asp.net facebook google-plus facebook-social-plugins

我的页面上有一个Google+和Facebook赞按钮。我有他们所需的脚本并动态设置数据属性。但是,当我点击分享按钮或喜欢按钮时,它打开随机图像和标题。我有meta标签,他们可以识别我想使用的标题,图像和描述,但他们不会拿起元标记。

以下是Facebook Developer Debug Tool的错误

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格式呈现元标记

<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 Scripts

<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属性,并在其中放入一些我看不到当前页面网址的代码。至少我可以在facebook标签中看到

但是,单击时BOTH不会提取我的元标记信息。请帮忙。

1 个答案:

答案 0 :(得分:2)

尝试在以下位置加载您的网址:http://www.google.com/webmasters/tools/richsnippets这会告诉您Google的网址是否可见。它还会告诉您标记中是否有任何错误。

相关问题