Facebook Like 按钮计数错误,喜欢的页面在网站上显示为不喜欢,并且未显示在 Graph API 中

发布于 2024-12-13 05:40:56 字数 1672 浏览 0 评论 0原文

我最近实现了 Facebook Like Button

我选择了一些设置(对于HTML5 实现)和 facebook 给了我以下代码:

<div id="fb-root"></div>
<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&appId=*my-app-id*";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like"
     data-href="*http://my-domain.com/page/uri*"
     data-send="false"
     data-layout="button_count"
     data-width="50"
     data-show-faces="false"
></div>

已经在我的公共网站上实现了这个代码。

当我单击该按钮时,它会将按钮更改为“喜欢”状态并显示一个对话框,我可以使用该对话框将其发布到我的墙上。

墙贴工作正常(Facebook 设法从页面中提取 Open Graph 元标记,如图像、标题、网址等...)当我刷新页面时,按钮显示为一个类似的按钮,但是当我访问与其他浏览器和 Facebook 帐户相同的 URL 喜欢按钮表示任何人喜欢该页面。

如果我然后检查我的 https://graph.facebook.com/me/likes in Graph API Explorer 之类的不会显示在列表中。

我还尝试使用 Facebook 的调试器 让 Facebook 刷新我在http://www.allwebmaster.com/2011/07/fix-facebook-like-button-not-working/ 但这似乎没有帮助。

那么墙柱可以工作,但类似的东西却不能,这是为什么呢?我该怎么做才能让它发挥作用?

更新:现在我在某些页面上有一些喜欢,但它与喜欢该网址的帐户数量不对应......

I have recently implemented the Facebook Like Button

I have chosen some settings (for the HTML5 implementation) and facebook gave me the following code:

<div id="fb-root"></div>
<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&appId=*my-app-id*";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

and

<div class="fb-like"
     data-href="*http://my-domain.com/page/uri*"
     data-send="false"
     data-layout="button_count"
     data-width="50"
     data-show-faces="false"
></div>

I have implemented this code on my public website.

When I click the button it changes the button to the "liked" state and shows a dialog that I can use to post to my wall.

The wallpost works fine (and Facebook manages to extract the Open Graph meta tags from the page like image, title, url and so on...) when I refresh the page, the buttons shows up as one like, but when I visit the same url with another browser and facebook account the like button indicates that the page is not liked by anyone.

If I then check my https://graph.facebook.com/me/likes in Graph API Explorer the like does not show up in the list.

I have also tried to use Facebook's Debugger to make Facebook refresh the data for the url as I found on http://www.allwebmaster.com/2011/07/fix-facebook-like-button-not-working/ but that did not seem to help.

So the wallpost works but the like does not, why is that? What can I do to make it work?

Update: now I have a few likes on some of the pages but it does not correspond to the number of accounts that has liked that url...

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文