Facebook点赞-浏览器刷新后将不再跟踪点赞 [英] Facebook Like - Won't keep track of Likes after browser refresh

查看:73
本文介绍了Facebook点赞-浏览器刷新后将不再跟踪点赞的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的一个网站中实现Facebook的赞"选项作为投票工具.用户将可以通过点击特定小组的个人页面来对其进行投票.我有很多团队,出于某种原因,当我喜欢"某些团队时,刷新浏览器,我的喜欢"计数会刷新,好像我根本从不喜欢"页面一样.但是,在其他一些团队页面上,当我喜欢"并刷新时,计数是准确的并且会保持跟踪.

I'm implementing Facebook's "Like" option in one of my websites as a voting tool. Users will be able to vote on a specific team by Liking the team's individual page. I have a number of teams and for some reason when I "Like" some of the teams, refresh my browser, my Like count refreshes as if I never "Liked" the page at all. However, on some of the other teams pages, when I "Like" and refresh, the count is accurate and keeps track.

我似乎找不到能起作用和不起作用的团队页面之间的区别.代码是相同的,但有些保留赞"计数,有些则不.我希望有人可能曾经经历过这种情况?

I can't seem to find what is differentiating between the team pages that work and don't work. Code is identical but some keep the Like count and some don't. I was hoping someone may have experienced this before?

下面是我使用的HTML5 Like选项:

Below is the HTML5 Like option I used:

<div class="votePanel">

    <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#appId=262057453824946&xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>

    <div class="fb-like" data-send="false" data-layout="button_count" data-width="120" data-show-faces="false" data-font="arial"></div>

</div>

下面是我的Open Graph标签:

Below are my Open Graph tags:

<meta property="og:title" content="My Page Title" />
<meta property="og:type" content="movie" />
<meta property="og:url" content="<% response.write("http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL")) %>" />
<meta property="og:image" content="PATHTOMYIMAGE" />
<meta property="og:site_name" content="Site Title" />
<meta property="og:admins" content="MYADMINID" />
<meta property="og:description" content="DESCRIPTIONHERE" />

推荐答案

嗯,我已经使用了一些资源.

Ah, I've got it working with a few resources.

首先,我使用 Facebook的调试器检查我打开的图形标签并确保它们有效.我注意到我的赞"按钮需要一个管理员ID.此外,在调试器"页面上,您可以实际演示喜欢"按钮,并且在必要时它将显示一条错误消息.

First, I used Facebook's Debugger to check my open graph tags and make sure they were valid. I noticed that my Like button required an admin ID. Also, on the Debugger page you can actually demo your Like button and it will display an error message if necessary.

我收到了消息:

"页面无法提供有效的管理员列表.它需要使用"fb:app_id"元标记或使用"fb:admins"元标记来指定管理员的逗号分隔列表,以指定管理员Facebook用户."

"The page failed to provide a valid list of administrators. It needs to specify the administrators using either a "fb:app_id" meta tag, or using a "fb:admins" meta tag to specify a comma-delimited list of Facebook users."

我发现我的fb:admins标签与og:admins混在一起了.我把字母换了,所有的东西都固定了!

What I noticed was that I had my fb:admins tag mixed up with og:admins. I switched the letters up and all was fixed!

但是,我仍然不确定为什么我的一些页面允许赞"按钮在修复前起作用.

However, I'm still not sure why a few of my pages allowed the Like button to work prior to the fix.

这篇关于Facebook点赞-浏览器刷新后将不再跟踪点赞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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