0

我的页面上有一个 Google+ 和 Facebook Like 按钮。我有他们所需的脚本并动态设置数据属性。但是当我点击分享按钮或喜欢按钮时,它会打开一个随机图像和标题。我有元标签让他们识别我想使用的标题、图像和描述,但不知何故他们没有选择元标签。

这是来自 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 中呈现元标记

<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 标签中看到

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

4

1 回答 1

2

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

于 2013-10-27T13:42:01.313 回答