Facebook Like button links to page with extra querystring values - facebook

Im creating a like button for the web page using
<div id="fb-root"></div>
<script type="text/javascript">(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=252715718165799";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="<?php urlencode(the_permalink()) ?>" data-send="true" data-layout="button_count" data-width="125" data-show-faces="false"></div>
Which when clicked creates a nice link with an image etc on the users facebook feed, however it links to the page's url with a large querystring appended
http://example.com/the/page?fb_action_ids=10200196914349100%2C10200196796266148%2C10200196791466028%2C10200196788705959%2C10200196713104069&fb_action_types=og.likes&fb_source=other_multiline&action_object_map=%7B"10200196914349100"%3A10151018009412671%2C"10200196796266148"%3A438799629541199%2C"10200196791466028"%3A336640529795478%2C"10200196788705959"%3A145466598973304%2C"10200196713104069"%3A10150401503152524%2C"10200196704543855"%3A466461563437987%7D
This url is arriving at the wordpress powered site and generating 303 forbidden errors.
How do i fix my code / game facebook into linking to pages without the massive querystring?

Related

facebook like button: my application replaced by like social plugins

I copy paste the facebook like button from
https://developers.facebook.com/docs/plugins/like-button#configurator
I insert that, problem is:
The button appears,
instead of liking my own page, it likes "social plugins" 2.3 millions !
What may I missed ?
<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/fr_FR/sdk.js#xfbml=1&version=v2.5&appId=1654009128211856";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
You need to enter your url on the configurer which you can find here:
You must have left the default link which is:
https://developers.facebook.com/docs/plugins/
Which has 2.3 million likes!
Good luck!
There is a form on that page that you plug in values, before you click "Get Code" to get cut-in-paste HTML code.
If you left their default URL in "URL to Like" there instead of your URL, this behavior would be explained

Facebook JS SDK not posting comments on timeline

I am using below code to implement facebook comment box on my site pages :
<div class="fb-comments" data-href="http://example.com/test/public/story/read-searched-story?story=rRDMpYpeHA22aFm4OFahuV50iFqswqjzFzl7BJPbnyo=" data-numposts="5" data-colorscheme="light"></div>
<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/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
When i am posting comment it asks to publish on facebook and when i click on post nothing happens either on my wall or activity log. any help will be appreciated..!!
After searching a lot found that facebook crawler needs some ogtags to crawl all pages mentioned on https://developers.facebook.com/docs/reference/opengraph/object-type/website/ and you can check your URL on https://developers.facebook.com/tools/debug/.

Facebook like plugin suddenly showing 0 count

The facebook like plugin counter was working fine until today. Now the plugin shows 0 likes.
<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/sdk.js#xfbml=1&appId=708684989223064&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<div class="fb-like" data-href="https://www.facebook.com/edmhuntersofficial" data-layout="box_count" data-action="like" data-show-faces="true" data-share="false"></div>
I checked with Facebook's Object Debugger and there don't seem to be any issues.
https://developers.facebook.com/tools/debug/og/object/
My website's URL where it is live is here
It was an issue at Facebook's end. It's solved now.
If you change the canonical tag url that count will back to zero count make sure keep canonical url same and also its case sensitive

how to load facebook activity feed in website only when called or facebook is selected

I have successfully added facebook activity feed in my site.But now I have a dropdown with functions as facebook, twitter, rss feed and so on.So only when I click facebook from the dropdown activity feed should be loaded in that specific portion.How am I do that.I have included the following.
<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";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
I tried to append as follows.
parents.append('<div class="fb-activity fb_iframe_widget" data-header="true" data-height="300" data-width="300" data-action="like,comment,recommend,share,suggest" data-site="http://www.icimod.org/" data-app-id="118280394918580" fb-xfbml-state="rendered">');
but it only shows the above div and no feeds.
Any suggestions/advice are welcome.Thanks in advance.
User $.getScript() to dynamically load the script once facebook option is loaded.
$.getScript(url)
.done(function(){
parents.find('div.item').append('<div class="description disp hover"><div class="fb-activity fb_iframe_widget" data-header="true" data-height="300" data-width="300" data-action="like,comment,recommend,share,suggest" data-site="http://www.icimod.org/" data-app-id="118280394918580"></div></div>');
});
get to know about $.getScript().

Facebook like button comment box not working with flickr

I have a js fiddle that demonstrates the issue
http://jsfiddle.net/RLQUR/
<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";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="http://www.flickr.com" data-send="true" data-width="450" data-show-faces="true"></div>
The code in the fiddle is directly from the facebook like button generator.
If you change the url to something like "http://www.google.com" it works just as it should. However, when using a flickr url and trying to click "Post to Facebook" it makes an AJAX request and returns with a status of 200 OK but does not post the comment to the profile or close the popup.
I believe this is likely a bug with the facebook like button, however I am unable to create a bug on the developer page for an unknown reason. I do not see a "Create" button on the page.
Any help is appreciated.