How can I like a post/comment in facebook fan page from my custom website - facebook

I am importing the posts and comments in my FB fan page to my custom website. I am importing using graph api. In the response array I am getting two types of action URL for "comments" and "likes".
See below :
http://www.facebook.com/149263441795729/posts/240758399312899
Using this link in following code
<fb:like href="http://www.facebook.com/149263441795729/posts/240758399312899" width="450" height="80"/>
I get the following error
The page at http://www.facebook.com/149263441795729/posts/240758399312899 could not be reached.
How can I like these posts or comments from my website? Is there any solution for that?

I think--I'm no expert here--that redirects such as this are controlled by Facebook, with a cross-site scripting policy file on their servers that say whether or not they will allow redirects and to who. On my website for example I allow anybody to cross link, since I'm just a little guy, but I bet Facebook only allows it with preferred partners like various corporations, see the story below. That would be my best guess.
Paul
http://thenextweb.com/facebook/2011/09/15/facebook-may-be-adding-cross-linking-to-foursquare-yelp-gowalla-and-more-on-pages/
Facebook may be adding cross-linking to Foursquare, Yelp, Gowalla and more on Pages
Facebook appears to have added cross-linking between Pages and other location-based sites like Foursquare, Yelp, Gowalla and SCVNGR to its Pages, reports Scribbal. Tech evangelist Robert Scoble posted a notice on his Google+ profile earlier today that indicated a new partnership between Foursquare and Facebook as the Page for a place was shown to direct viewers to the comparable location on Foursquare.
The links appear off to the left underneath the ‘Like’ count and checkin count on a location’s page. The only question that remains is whether the users are activating these connections themselves or if it is something that is done automatically. This could be Facebook’s plan to integrate itself with other location sites now that it has distributed the Facebook Places features throughout its framework.
Facebook has been on a tear lately, adding the Subscribe button and smart Friends list features just this week, as well as Facebook integration into the new Skype for Mac. It is clearly making an effort to maintain its lead over Google+ as the preeminent social network and it doesn’t want lack of features to be a reason for anyone to quit it.
We have reached out to Facebook about this new feature and will update this post when we hear back.

Related

Facebook Like button for one facebook page of an app from it's own ios app

I am looking for Like Button to be shown in my ios native app, users of that app have already connected to app via facebook account.
there are several questions related to Facebook Like Button on stackoverflow but those are not specific to authorized single facebook page of the app.
According to official doc of facebook, facebook pages can not be liked via built-in action o open graph api.
But want only one official facebook page of that app to be liked by user when he hits like button. i don't want user to navigate away from the app or login again in web view to like facebook page.
is it possible to like app's facebook page without promoting user to log in again in webveiw?
Edit
Findings
1. https://stackoverflow.com/a/5837036/1632984
2. Comment by wallacer
"the general consensus does seem to be that you can't like a page on behalf of the user, however I just had an ios game like a page on my behalf. Extreme Road Trip successfully manages to get you to like their own page. I wish I'd paid more attention when I did it now..." – wallacer
This still can't be done directly using the graph api ( to the best of my knowledge ). What you can do is open a webview to the page you want the user to like. If you're rewarding their liking your app or something, when they close the webview (you'll have to provide a close button), you can use the graph api to check whether they like your app page. As far as I can tell this is the best current solution - and seems to be the approach taken by mobile games.
That said, I haven't used Facebook SDK 3 yet, so there may be something in there that could help you.
It appears that Liking a page on behalf of a user is still impossible. I've glanced over the iOS SDK Reference, and it doesn't seem like there is a built in mechanism to like anything.
However, in reading one of the other posts you linked to, and remembering that Facebook opened up the Like open graph action so app developers could allow their users to like content generated by their application...I found this link about built-in-actions (likes).
According to that link, you can post Like actions to your users by POSTing to https://graph.facebook.com/<user_id>/og.likes with the POST params for object (the open graph object URL you want to like on behalf of the user in this case your page's url. eg. www.facebook.com/yourpage) and access_token (obviously, for your user).
I'm not totally convinced that will work; though it is conceivable. My second thought would be to create an Open Graph Object for your page, and have all your users like that. Though, that is a little less ideal, as it removes the possibility of people finding your Page while they're on Facebook and would require you to put a lot more effort into getting likes for the Page via your website, application, etc.
I hope that helps a bit, good luck.

Get Facebook referral URL in Google Analytics

In my Google Analytics reports I get "facebook.com / referral" as the source. Is it possible to get the exact URL?
I don't think it's possible. as #yahelc pointed on a previous comment most traffic from facebook goes through a facebook controlled redirect on page facebook.com/l.php .So if you want to have campaigns on facebook you can use urls with campaign query parameters to keep track of it.
eg: link to
http://www.example.com/?utm_campaign=Facebook&utm_medium=social&utm_source=facebook.com
Now they will show up in GA as a separate campaign and you can tell how many visitors come from that specific link. You probably want to minify that link using bit.ly or goo.gl.
Create multiple campaigns on facebook and change the utm_campaign parameter as much as you want. You can also create different utm_content parameter to separate your marketing efforts on facebook. Keep the utm_medium and utm_source as static as on the example above.
This is how social marketing analytics measures marketing efforts on social networks. Anything that comes from facebook is not tagged you know comes from people posting links to your site other than you.
At the same time it really makes no sense to have the referral url at all. If you think about it most of the times it will be from private posts that you don't even have access to see, even if you had a url for it. That's just not the way facebook works. It doesn't have pages, it has streams and posts.
More about url tagging:
http://support.google.com/analytics/bin/answer.py?hl=en&answer=1033863
The answer is yes and no. You can drill down to referral path for facebook source in the report Traffic Sources -> Sources -> Refferals by simply pressing facebook.com at the Source coloumn, just like for all other visits from the referring site.
But that would be not much of a use, because for facebook you'll always see /l.php. And that's how facebook works, it doesn't allow visitors to visit the link immedeately, instead it redirects user to the page with url facebook.com/l.php?u=<link-to-your-site.com> with a redirect or maybe with some text like "if you're sure you want to leave", so technically, the referring page would be this /l.php that GA shows.
So if you need to track the efficency of your Facebook activities - use utm tags, like #Eduardo Cereto mentioned. Here's a very nice video tutorial on link tagging for GA: http://services.google.com/analytics/breeze/en/v5/campaigntracking_adwordsintegration-v23_ia5/ (starts from p. 17, you can skip all that goes before).
Hope it helps!
i just know this settings here:
http://www.sebastienpage.com/2009/05/06/google-analytics-trick-see-the-full-referring-url/

developing/testing facebook apps while I'm not a facebook fans

My next side project is a facebook app. I spent a day on reading through the facebook documentation, and then figured out my facebook wall is almost blank. So how can I get enough sample data for developing/testing facebook apps in a quick way? Or which facebook geek has an account with tons of public data that I can test my app with? (I know I can create several test users and friend/comment on/like/... each other, but it is tedious to do this you know.)
Test users cannot interact with other users outside of their app, so I think what you're thinking there doesn't work. Additionally, it's against Facebook TOS to log into another user's account and I'm not aware of any public data sources. Regarding finding a bunch of Facebook pages, check out the Facebook page browser, which allows easy liking and management and should fill up your feed in no time.

Liking a page on behalf of a user?

I'm trying to get a user to 'Like' a page via the SDK. User is signed in and I get a valid access tokken form the cookie. My APP has asked for permissions read_stream and publish_stream. I can successfully do things like post to their wall, etc. But when my APP tries to 'Like' a page, I get the error back:
OAuthException: (#3) Application does not have the capability to make this API call.
Am I missing some other permission, or is there a setting I have to turn on in my APP? I'm at a loss here.
You can't like a Page on behalf of a user (Bugzilla discussion). You can, however, like posts, comments, and photos on behalf of a user.
Edit 7/9/2012
Since bugzilla no long exists, the bug linked above is inaccessible. Google doesn't have a cached version of the page, so I ran another search. The best thing I could come up with was this Google Code Discussion regarding the ActionScript API.
Facebook makes brief mention of Publishing likes via the Graph API in the documentation, but doesn't say one way or another whether you can like a Page on behalf of a user - just "Objects" which (probably arguably) are not "objects" in Facebook-lingo.
My thought is, the API to like page is available, but is only offered to white listed applications (such as, the Facebook iOS and Android applications) written by "special" publishers. There's obvious reasons why Facebook wouldn't want/allow developers to create like connections on the graph. It would be taken advantage of by spammers and other nefarious developers and would deteriorate the meaning of what a "like" represents for a page on Facebook.
My guess is, you'd have to make a pretty strong case to Facebook about why you need/want access to the Page's Like connection (for publishing) before they'd even consider giving you access. I'd also guess that they'd want to verify that you're doing only user initiated like creations (in such a way that the iOS application would handle it) so as to protect the reptutation/meaning of a "like" action.
Actually this is NOT true, but you have to do a complicated Javascript / UIWebView process in order to display a Facebook 'page' of JUST the like button on your view, and this like button you can configure in the JavaScript / Objective-C (using string replacement) to be any Facebook page url you like.
Facebook's platform policies don't allow for a web-based like button aside from using the officially supported options
Those options doesn't require using OAuth or the Open Graph api. However, facebook just added support for mobile apps to send like actions through opengraph.
I'm not sure if they intend to allow sites to customize their like buttons or just apps...
Liking works for me with the iOS SDK using the graph api:
https://developers.facebook.com/docs/opengraph/actions/builtin/likes/

Hiding application source when posting to Facebook fan page via graph API

I've successfully posted to a fan page as the actual page via the Graph API.
The problem is that the post says it was posted at "time via application name". Is there any way to hide this, so my post looks exactly as if I typed it directly into Facebook?
I'm building a messaging center that can easily deliver messages on many different channels, Facebook being one of them. Clients probably won't appreciate their Facebook posts linking to my application, nor do I want to set up a new Facebook application for each client.
There is no way to disable this. It is an internal Facebook system and is very deliberate on their part to show users where content comes from and make it easier to report malicious and spammy apps.