Facebook打开图形错误 - 推断属性 [英] Facebook Open Graph Error - Inferred Property

查看:1278
本文介绍了Facebook打开图形错误 - 推断属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在每个页面上,我都在头上部分显示了这个:

 < html xmlns =http://www.w3.org/1999/xhtmlxmlns:og =http://ogp.me/ ns#xmlns:fb =http://www.facebook.com/2008/fbml> 

然后在头部我有:

 < meta property =og:titlecontent =本页标题/> 
< meta property =og:typecontent =product/>
< meta property =og:urlcontent =http://www.mywebaddress.com/>
< meta property =og:imagecontent =http://www.myimage.jpg/>
< meta property =og:site_namecontent =我的网站名称/>
< meta property =fb:adminscontent =10101010101/>
< meta property =og:emailcontent =hello@mywebaddress.com/>
< meta property =og:descriptioncontent =我的产品说明。/>

然后我有一个喜欢按钮,代码如下:

 < script>(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_US/all.js#xfbml=1;
fjs.parentNode.insertBefore(js,fjs);
}(document,'script','facebook- jssdk'));< /脚本>
< div class =fb-likedata-href =http:// thispagesurldata-send =truedata-width =350data-show-faces =false> < / DIV>

对我来说,似乎所有的东西都可以复制到 Facebook开发者页面,但是当我喜欢',Facebook似乎只是拾起页面标题和一般信息。



我已经尝试使用他们的对象调试器调试页面,我收到以下警告:

 推断属性应该显式提供og:url属性,即使可以从其他标记推断值。 
推断属性应该显式提供og:title属性,即使可以从其他标记推断值。
推断属性应该显式提供og:image属性,即使可以从其他标记推断值。
推断属性应该显式提供og:locale属性,即使可以从其他标记推断值。

据我所知,我已经按照Facebook的说明来信,但我没有快乐。任何人都可以指出,如果我做错了什么?



提前感谢
Dan

解决方案

这些标签是http://www.mywebaddress.com吗?



请记住,linter将遵循og:url标签,因为此标签应指向该内容的规范网址,因此,如果您有一个页面,例如'http://mywebaddress.com/article1'与 og:url 标签指向http://mywebaddress.com,Facebook会去那里阅读标签还有。

如果没有,最常见的原因是看到正确的标签没有被linter检测到,因为用户代理检测将不同的内容返回到Facebook的抓取工具您手动检查


时所看到的内容

I'm trying to implement Facebook's OpenGRaph protocol on my product pages.

On each page i have this above the head section:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">

Then within the head section i have:

<meta property="og:title" content="This Page Title"/>
<meta property="og:type" content="product"/>
<meta property="og:url" content="http://www.mywebaddress.com"/>
<meta property="og:image" content="http://www.myimage.jpg"/>
<meta property="og:site_name" content="My Site Name"/>
<meta property="fb:admins" content="10101010101"/>
<meta property="og:email" content="hello@mywebaddress.com"/>
<meta property="og:description" content="Description of my product."/>

I then have a 'like' button with this code:

        <script>(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_US/all.js#xfbml=1";
        fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        <div class="fb-like" data-href="http://thispagesurl" data-send="true" data-width="350" data-show-faces="false"></div>

To my eye, everything seems to replicate what can be found on the Facebook Developers page but when i 'like', Facebook is seemingly only picking up on the page title and general info.

I have tried to 'debug' the page using their Object debugger, and i get these warnings:

Inferred Property   The og:url property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property   The og:title property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property   The og:image property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property   The og:locale property should be explicitly provided, even if a value can be inferred from other tags.

As far as i can tell, i have followed Facebook's instructions to the letter, but i have no joy. Can anyone point out if i'm doing anything wrong?

Thanks in advance, Dan

解决方案

Are those tags on 'http://www.mywebaddress.com'?

Bear in mind the linter will follow the og:url tag as this tag should point to the canonical URL of the piece of content - so if you have a page, e.g. 'http://mywebaddress.com/article1' with an og:url tag pointing to 'http://mywebaddress.com', Facebook will go there and read the tags there also.

Failing that, the most common reason i've seen for seemingly correct tags not being detected by the linter is user-agent detection returning different content to Facebook's crawler than the content you're seeing when you manually check

这篇关于Facebook打开图形错误 - 推断属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆