0
我的頁面上有一個Google+和Facebook Like按鈕。我有他們需要的腳本和動態設置數據屬性。但是當我點擊分享按鈕或像按鈕,它隨着隨機圖像和標題打開。我有元標記爲他們識別標題,圖像和描述我想使用,但不知何故,他們沒有拿起元標記。facebook,google +分享按鈕無法識別我的meta標記
下面是從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.
渲染Meta標籤在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標籤
但是,點擊時不會拉我的元標籤信息。請幫忙。
我會嘗試這一個....但感謝鏈接... –