facebook page widget shows different app id when user not logged in facebook and try to like page - facebook-graph-api

I have Facebook page widget, and i want to track if user liked my page or not. If not then force them to like. I did code for that, but now issue is when user try to like page and not logged in, Facebook open login window and app id is different on that window(which is default, don't know from where it takes).
And because of that, users not able to authorize my app. And i cant track details of that users.

Make sure you are using Page Plugin, instead of the now-deprecated like box. It's hard to say without seeing any code, but it sounds like you are either using the SDK/plugin incorrectly, or using something like a 3rd party wordpress plugin that may be acting maliciously by injecting another ID.

Related

Can I prompt a user to log in to facebook through a bookmarklet generated div?

I'm looking to see some info about my facebook contacts, and I want the info to be overlayed on the currently open website.
Currently, I'm trying to do this via a bookmarklet.
Is it possible for me to overlay a div over the currently open web page and populate it with a functioning facebook login button (if the user is not logged in)? Are there publicly available working examples of something like this?
It is probably not possible to simply embed Facebook within an iframe because Facebook blocks people from embedding their pages within frames or iframes by putting this into the response header, "X-Frame-Options: DENY". This is most likely to prevent click-jacking and similar security exploits.
To test this, enter any page from Facebook into http://savanttools.com/testframe
Facebook has an API which allows you to do many things, but it requires server side code, and can not be done simply with a bookmarklet.
There is also always the brute force method where your server scrapes data from any website you want it to. Then that data could be put into a bookmarklet.
Finally, the same thing could be achieved by writing an add-on or a user script without using a bookmarklet at all.

Django and Post to Facebook (no authentication)

OK, I need some help understanding the process behind Facebook's website integration process and how I can integrate it into my web app....
In its most basic form, my site stores and displays users' comments about products (there's more to it than that, but that's all that's relevant for this question). What I'd like to do is allow them to post that comment, together with the name of the product (and my site), to their Facebook wall by clicking a button.
I do not need the users to log in to my site at all, either with Facebook or any other authentication system and the Post to Facebook part is optional.
Obviously if they decide they do want to post their comment to Facebook, then they'll need to login, but I'd rather temporarily take them away from the page to login, post and then be brought back to my site.
What I need to know is how much of Facebook's APIs, Open Graph and Auth systems do I actually need to integrate?
I had hoped that I might be able to generate a simple link to Facebook with their comment embedded as a POST element...?
I'd be really grateful if someone could point me in the right direction!!
(P.S. I need a similar solution for Twitter, but I think that's easier!?!)
The Feed Dialog doesn’t allow including of a pre-set message any more, so you’d have to make that post via the Graph API if you want to pre-fill the message (and even then, you should only do so, if you’ve given the user the possibility to edit the pre-filled message first).
See here for how to make a post on a user’s behalf via Graph API, https://developers.facebook.com/docs/reference/api/user/#posts
You can do that all client-side, if you embed the JavaScript SDK into your page.
You need to set up an app on FB, then have the user connect to it (using FB.login), ask for the necessary permission (publish_stream) while doing so, and after successful login use FB.api to make the Graph API call.

Help with design a facebook integration for my website.. App or Page?

I´m building a website to post my own videos using JW Player running my own ads as overlay.
www.planetsnowmobile.com
All my videos will be
Instead of register my own users, having my own forum etc etc I want to use facebook to interact with my visitors:
Individual discussions/comments on individual films instead of my own comment/forum-function
facebook-like-button for individual films (so induvidual like buttons for individual films)
Share induvidual films
Grab location from every unique visitor
Where do I start?
Do I need to create an application or should I use a Facebook "page"?
Maybe both?
I see that i can add an application to a "page" but what does that really do? How do I use that?
What would be the best way for me to do this?
I already have a Facebook "page" for my website and I just created an App as well.
Which one should I use?
Do I need both?
What is the difference?
I know that I can create a like button for a website address on http://developers.facebook.com/docs/reference/plugins/like/
But can I monitor that like button from example an application if I can connect them somehow?
Is that something I want to do?
My Facebook-page already have a user-base where my Facebook-application does not.. is my best option to delete my "page" and start all over with my "application"?
App is their encompassing term for any application that uses their API, this could be on Facebook or on your own personal website - these require an API key to make authenticated calls for users. Pages are FB's own in-Facebook content that users have created, like page for a business located at facebook.com/mybusiness. It sounds like you already have a website and want to add Facebook functionality to it, so you don't want to make another Page. You may not even need to create an App. Things like comment boxes and like buttons can be dropped in as stand-alone copy-and-paste widgets. You can track the like button by enabling FB insights for your website.
So like you noticed you can add a like button to your page using the social plugin from http://developers.facebook.com/docs/reference/plugins/like/ - similar to the like button you can add comment boxes with the plugin at http://developers.facebook.com/docs/reference/plugins/comments/
You can track the results from these plugins by adding your website to Facebook's analytics (Insights) at http://www.facebook.com/insights/
Most of these things are powered by the opengraph metadata in the headers of your website's pages. You can read up on what tags FB uses here http://developers.facebook.com/docs/opengraph/
Everything at http://developers.facebook.com/docs/plugins/ can be used without an application or page ID, and is very good about being responsive to the page they are hosted on: you can add a like button to your video view template without a defined URL in the like button's parameters, and it will automatically direct any likes to the url of the currently viewed video.
You could also direct a like button to point to your existing FB Page, in which case any likes collected from it would be added to the Page's total. Most companies that have a home-page like button do this, so their likes all accumulate to a single total for their business.
Hope that helps.

How can I allow my users, who create pages on my website, to communicate back to those people who click the Facebook "Like" button on their pages?

OK, apologies for the verbose title. Let me give the background in a bit more detail.
My website allows my registered users to create new pages, each of which has its own unique URL. Each page has a Facebook "Like" button on it. I've already implemented Facebook Open Graph API meta tags so that the pages are proper open graph objects, and when some other visiting Facebook user "likes" the registered user's page, a post appears on that Facebook user's wall saying they have liked the page. The Facebook Like widget also displays the number of "likes" that page has received as normal. So far, so good.
What I want to do is allow my registered users to be able to communicate back to the Facebook users who have liked their page. The community of "likers" for a page is a potentially valuable social media resource to the registered user, if only they could communicate back.
I am aware of the "admin page" link you get beside the Like button, which can be used to post to these people, but that is not an option for my registered users as they have no privileges in relation to the Like button.
What I want to do, if possible, is setup a form to capture the registered user's message back to the Facebook users, and then my website sends the message on their behalf, without having to ask for any extra privileges from the Facebook users.
The following Facebook documentation pages seem to say this is possible, but having followed the Open Graph API documentation, I can't get it to work as described - http://developers.facebook.com/blog/post/465/ and http://developers.facebook.com/docs/reference/api/ ("Publishing" subsection). I can get the access token correctly in the first request, and plug that into the second request to do the post, but that doesn't seem to do anything and doesn't return any error.
Since it doesn't work for me, I'm wondering if this is possible as described, or do I need to get some sort of extra permission to do this? I've seen reference to offline_access permission but as I'm new to this stuff I am not sure how it would fit in. If I have to get the Facebook users to grant permissions, this is not going to work as envisaged.
Any thoughts would be most helpful.
The short answer: No, You will never been able to post on someones wall as another user.
The long answer:
You could try to ask for offline access but then you are asking the user to hand over all their facebook data and give you access todo whatever you like their accound, so that is not likely to happend.
The next problem is that they have to be friends to be able to post on each others walls.
Thats why Pages was implemented, so that organisations could announce/talk with the people interested.
However if you have created the like button correctly and give the pages correct meta data, you are able to post to user who have liked it.
Scroll down to Publishing:
http://developers.facebook.com/docs/opengraph/
Just add a form for your user and let your system publish to the correct page, you probably will need a offline token from your own account or similar to use on the server.
Another more complex way could be to generate a facebook page for each page you have on your server.
When the user creates a page on your system a page is created on facebook but as your app as admin.
And when another user likes the page they like the facebook page, hence you have the possibility to post in that page and speak to the user who liked it. (whooa thats a mouthfull).

Facebook integration... Where to start?

I recently put a django project of mine into its beta stages and would really like to integrate more with social media, particularly facebook.
Now there are so many facebook integrations out there... I don't know where to start but, I'll tell you what I am after.
My sites publishes content with photos and also user related data (which site doesn't)
on each individual page I already have a facebook like button that basically has the absolute url of that page
so for instance:
http://my-site.com/url-1
http://my-site.com/url-345345
http://my-site.com/url-456456456
When a user likes this particular url I would like them to become a Fan on my facebook site/page as well.
I also added the FB opengraph tool which is a bit more informative once a user likes it. But it still does not publish any statistics to my page.
Can someone give me a bit of an understanding on what the best option is for this type of integration?
As a security option for the user, Facebook has never allowed third party access to "become a fan."
If you want to record locally when someone presses the "Like" button, you'll have to implement it locally (copy the presentation, and query Facebook yourself), so you can intercept the event. I've done that; it's not too hard.
I suggest you review the Connect Terms of Service to see what it is you're allowed to do: http://developers.facebook.com/policy/