在所有浏览器中,facebook 点赞计数未显示在具有 html5 或 iframe 代码的特定域上

发布于 2025-01-01 23:25:44 字数 2465 浏览 3 评论 0原文

我明白这可能被解释为一个有点蹩脚的问题,但这个问题让我完全困惑。我根本无法让特定域显示“点赞”按钮计数。在另一个域上完全相同的代码可以正常工作。

有问题的域名是 www.gold.org。我制作了四个测试用例,每个测试用例基本上都使用来自 FB 网站的代码。在每个示例中,要点赞的 url 都指向域的主页(除非指定)。

http://www.gold.org/test.php - HTML 5 实现,此页面也包含其他示例和开放图形信息的链接。

我花了一些时间来确保正确的 OG 标签到位(使用 facebook 调试工具),每个站点都有管理员 ID,甚至为每个站点实现了 facebook/insights。 gold.org 域已经使用 addthis.com 分析一段时间了,我最近升级了代码以使用本机社交按钮代码。见解报告显示有足够的​​流量来保证显示的计数,并且 gold.org 主页的 fql 查询当前报告的计数为 86。

下面是来自 gold.org 域的一些示例代码,供那些无法/不愿意检查示例的人 使用多于。 goldinspirations.com 域中的测试用例是相同的,但具有该网站的相关 url 和 OG 标签。

如果有人能阐明这一点,我将不胜感激。我在 FB stackoverflow 网站上阅读了许多与此问题相关的其他问题/答案,并且我相信我已经正确实现了所有内容。如果我错过了什么,请随意用火焰将我射落,我保证拍着我的额头说“DOH”。

非常感谢

<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FB Test</title>
<meta name="robots" content="index,follow" /> 
<meta name="copyright" content="Copyright (c) 2012 World Gold Council" /> 
<meta name="author" content="http://www.gold.org" /> 
<meta name="publisher" content="World Gold Council" /> 


<meta property="og:title" content="Homepage &gt; World Gold Council"/>
<meta property="og:description" content="The World Gold Council – the market development organisation of the gold industry and voice of authority for gold" />
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://www.gold.org/"/>
<meta property="og:image" content="http://www.gold.org/assets/static/www.gold.org/img/favicon-apple.png"/>
<meta property="og:site_name" content="World Gold Council"/>
<meta property="fb:admins" content="100001681197681,536819656" />

</head>

<body>
<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_GB/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div id="fb-root"></div>
<div class="fb-like" data-href="http://www.gold.org" data-send="true" data-layout="button_count" data-width="300" data-show-faces="false" data-font="arial"></div>                    
</body>
</html>

I appreciate this could be construed as a somewhat lame question but the issue has me utterly perplexed. I simply cannot get the like button count to show up for a particular domain. The exact same code on an alternative domain works fine.

The problematic domain is www.gold.org. I have made four test cases, each using code basically verbatim from the FB website. In each example the url to be liked points to the domain's homepage (unless specified).

http://www.gold.org/test.php - HTML 5 implementation, this page also contains links to the other examples and open graph info.

I have taken time to ensure that the correct OG tags are in place (using the facebook debug tool), that each site has admin ids and have even gone as far as to implement facebook/insights for each site. The gold.org domain has used addthis.com analytics for sometime and I have recently upgraded the code to use native social button code. Insights reports show enough traffic to warrant the count being displayed, and an fql query for the gold.org homepage currently reports a count of 86.

Below is some sample code from the gold.org domain, for those unable/unwilling to check the examples above. The test case in the goldinspirations.com domain is the same, but with relevant urls and OG tags for that site.

If anyone could shed light on this I would be entirely grateful. I have read many other questions/answers related to this issue here on the FB stackoverflow site, and I believe I have implemented everything correctly. Feel free to shoot me down in flames if I have missed somethingm, I promise to slap my forehead and say DOH.

Many thanks

<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FB Test</title>
<meta name="robots" content="index,follow" /> 
<meta name="copyright" content="Copyright (c) 2012 World Gold Council" /> 
<meta name="author" content="http://www.gold.org" /> 
<meta name="publisher" content="World Gold Council" /> 


<meta property="og:title" content="Homepage > World Gold Council"/>
<meta property="og:description" content="The World Gold Council – the market development organisation of the gold industry and voice of authority for gold" />
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://www.gold.org/"/>
<meta property="og:image" content="http://www.gold.org/assets/static/www.gold.org/img/favicon-apple.png"/>
<meta property="og:site_name" content="World Gold Council"/>
<meta property="fb:admins" content="100001681197681,536819656" />

</head>

<body>
<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_GB/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div id="fb-root"></div>
<div class="fb-like" data-href="http://www.gold.org" data-send="true" data-layout="button_count" data-width="300" data-show-faces="false" data-font="arial"></div>                    
</body>
</html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文