Question

I have a website with a Facebook Like button on the landing page of the domain using the below code

<!-- FB button 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_GB/all.js#xfbml=1&status=0";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));</script>
<!-- FB button code end -->

which is the default code supplied by FB, and where the &status=0 was added as per FB.getLoginStatus() called before calling FB.init()

and the code to the actual button is

<li><div class="fb-like" data-href="http://www.vinner.com.au" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div></li>

This was working okay for a while but any new likes on the FB page itself suddenly stopped at 26 and my like of the page is registered as the screenshot below

enter image description here

however the actual website reset the Like count to a lower number, and I'm able to relike the page (and I'm logged into FB on the same browse)

enter image description here

I've raised a bug with FB but they don't respond to individual requests, so hoping someone out there can identify if I've done something wrong in my config, and can explain why I have a different Like count, and why I'm able to relike a page I've already liked.

Was it helpful?

Solution

According to the documentation of Like Button, the data-href property is -

The absolute URL of the page that will be liked.

You are giving it the url to your website, i.e. http://www.vinner.com.au, and expecting it to sync with the likes of your facebook page. How is this possible?

The liking an external url and liking a facebook page are two different things.

To sync your facebook page's likes with your like button - you should provide url of your fb page to the like button-

.... data-href="{link-to-your-fb-page}" ....
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top