I have a site with smart-urls that lets you build up a dynamic url based on some user interaction. I devised a button using sharer/sharer.php?u=someurl.
EDIT: ** SomeUrl is a shortened-url ( using bit.ly)
The thing is sometimes someurl gets ignored and the post links to some other url ( which is the one defined on the og:url of the site). This happens somehow randomly.
href = href.replace('|u|',shareHref).replace('|t|',t).replace('|140|',t.substring(0,130))
window.open(href,'t','toolbar=0,resizable=1,status=0,width=640,height=528');
Any thoughts?
So, I've finally switched to FB.ui dialogs. The docs say sharer.php works only with ?u parameter but I've found it impossible to fix the bug mentioned above. If you're struggling with sharer, consider using FB.ui is fairly easy to integrate.
Related
I try to share an URL that contains query parameter in FB.
Here is my share link
Sharing works but my custom query parameter is gone and replaced with facebook query parameters in the facebook timeline something like here
The same problem when FB.ui({ method: 'share',... is used.
It worked well on previous version of facebook sharing sharer.php but it's deprecated now and I have no idea how to make current share work.
We faced same problem. We instead used Feed Dialog that works fine. The irony is that if you read on facebook's developer's site Facebook is recommending us using Share Dialog in place of Feed dialog however, Share dialog does not work as expected.
Here is the link to get more information on Feed dialog
https://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.2
Personally i like Feed dialog more the share cause it gives you some additional properties to manage how dialog should appear
i assume you solved your problem in a different way already but i have found a solution for this. Just in case somebody else comes across this question.
Facebook strips the parameters only when it is more or less sure that the file is an php file.
So for http://example.com/?test=1
or http://example.com/index.php?test=1
the parameters are removed.
But if you make it look like a normal html file, it works:
http://example.com/whatever.htm?test=1
for example is posted with the parameters.
Of course you can use some simple mod_rewrite Rule to redirect the request to the original php file:
RewriteRule /whatever.htm(\?.*) /index.php%1
(rule is untested but should work hopefully)
This morning I found out that Facebook is not returning the fb_ref parameter when you add it to links in actions or likes. Instead they seem to have replaced it with a series of new parameters: action_ref_map, action_object_map, ...
Could someone confirm me this change? This is breaking our software.
EDIT
This is an example that I've found:
http://uk.omg.yahoo.com/news/john-travoltas-year-gay-affair-pilot-revealed-122446486.html?fb_action_ids=10151047496853334&fb_source=other_multiline&action_object_map={%2210151047496853334%22%3A10151788645595106}&action_type_map={%2210151047496853334%22%3A%22news.reads%22}&action_ref_map={%2210151047496853334%22%3A%22type%3Aread%2Cuser%3A1k-WK59_Yk-EnPq2w1zMLBjX7nA%22}&code=AQCH-sq6XRSQCXj4QNkKlnusWLgIvBaZduNhGO0RNdiXgfCSGUOd1qinfHVw1iFQfs-0KVxFdPpWXD9nWrjEC1naU87H5W4GnxnTPL5j2raksea2pFxuy0rtgSpAa6ExZYCc7PkzIyjNnGTdK6N7g0Spb7qiqSboTgWZOojQJYbEF2XHenlROjhP8--NkvzrxU8#_=_
EDIT 2
It seems that Facebook has activated a new system for returning "fb_ref" in sandboxed FB apps.
https://developers.facebook.com/docs/fb_source/ is (and should be) the primary source of referral information and open graph actions have always had their own referral parameters showing which actions were present in the story/aggregation which triggered the click
fb_ref is provided when you had a 'ref' parameter on the source publish but as far as i know there hasn't been a change there
(e.g. like button with ref = foo results in a click back to your app with fb_ref=foo, fb_source=ticker or something like that)
I'm running my site on Cargo Collective and trying to have likes per page. I cannot modify the code in the head tag only within the body tag.
When i debug a page i get the following;
Response Code 206
Fetched URL http://www.iamneuron.com/Break-this
Canonical URL http://www.iamneuron.com/Break-this
URL for Likes http://www.iamneuron.com/#Break-this
Final URL http://www.iamneuron.com/#Break-this
I can't figure this out and i have been searching for a while now. Even if i explicitly specify the url rather than leaving the code to figure it out, facebook still adjusts the url to one that doesn't work with the trailing #.
Originally i was trying to create the like code via facebook but i have now switched to this which works better with cargo but still produces the same error:
http://randomcodescraps.tumblr.com/post/1363402555/js-dynamic-like-button-on-cargo-collective-projects
Anybody any ideas? Thanks in advance btw!
Your page doesn't have any OG tags that Facebook can use. And those that are in your page are commented out. Add proper OG tags and then use the link tool to check you tags and see if still have the same problem.
My application has "survived" many Facebook API changes, to the point where it's quite messy.
Anyway: I'm no longer able to POST a simple HTML form. The entire page reloads and no data is saved.
I've tried several things. Changing the "action" url to include several Facebook parameters, changing the target (canvas_iframe) but to no avail.
Has anyone else encountered problems with this?
try to write absolute path in "action". Its not important include Facebook parameter
Give site url("www.example.com/") as the value of the action attribute rather the Canvas URL(http://appifylabs.com/facebook/yourapp/processform.php)
e.g
if processform.php is the script that will manipulate your form so give the value
site_url = "www.example.com/";
action="<?php echo site_url; ?>processform.php"
I have installed facebook like button with javascript solution.
I left the href attribute empty so it will use the current url for counting. It seems that right now , even after changing the href attribute , facebook is counting the like on my entire website.
Example:
1. domain.com/fb_url
2. domain.com/fb_url2
If you will like the first url , you will be able to see the likes on the second url.
Why not putting into the href attribute the absolute URL of the page? I guess this will fix the issue. This can be easily achieved in whatever language you use. Please post the code you are using so that we can provide further help.
If you used og:url tag, you although have to change it on each page.