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

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

问题描述

我正在尝试在我的产品页面上实施 Facebook 的 OpenGRaph 协议.

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

然后在我的头部部分:

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

在我看来,一切似乎都复制了 Facebook 开发者页面但是当我喜欢"时,Facebook 似乎只接收页面标题和一般信息.

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.

据我所知,我已经按照 Facebook 的指示去做了,但我并不高兴.谁能指出我做错了什么?

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?

提前致谢,丹

推荐答案

那些标签是在http://www.mywebaddress.com"上吗?

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

请记住,linter 将跟随 og:url 标签,因为此标签应指向内容片段的规范 URL - 因此,如果您有一个页面,例如'http://mywebaddress.com/article1' 带有一个 og:url 标签指向 'http://mywebaddress.com',Facebook 也会去那里读取标签.

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.

如果做不到这一点,我所看到的看似正确的标签没有被 linter 检测到的最常见原因是用户代理检测返回的内容与您手动检查时看到的内容不同

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天全站免登陆