site URL for the facebook like button - facebook

I have a problem with the Facebook like button. I want the note on user's profile to look something like this: 'User likes page on site'.
Site's URL it suppose to be 'http://www.example.com/myapp/' and the page URL it's 'http://www.example.com/myapp/page.html'.
I added <meta property="og:site_name" content="..."/> in the of any page and added the like button using <iframe>.
I know that there's a solution to specify the canonical URL, but for the page that user likes, not for the site (that is by using og:url on the header). Does anyone know how you can specify the site's URL? It somehow automatically points to the domain name, which it's wrong in my case because i need 'http://www.example.com/myapp/', not 'http://www.example.com'.
I want the following result: User likes 'http://www.example.com/myapp/page.html' on 'http://www.example.com/myapp', not User likes 'http://www.example.com/myapp/page.html' on 'http://www.example.com'.
Thank you very much for a possible answer.

We've been running into similar problems and in lieu of a og:site_url tag have had to get a little hacky. Our solution is to have our base URL (http://www.example.com in your example) redirect to the FB page.
As we add more FB pages, we'll need multiple subdomains to support this, so it's not really sustainable, but may solve your problem at least temporarily.

Related

Facebook sharer and parameters in url

I have a Wordpress page that needs a GET parameter in URL.
Depending on the id, it shows a different flipbook.
The problem is, when I share the link on Facebook, it crops the GET parameters (I checked with the Open Graph Debugger), so the page doesn't receive any parameter, thus there's no thumb showed.
I already tried encoding the URL with PHP.
So, two questions:
Is it possible to make Facebook recognize the GET parameters in URL?
If not, can I work out something with the .htaccess file, to make them appear like subpages? E.g. www.page.com/flipbook/?id=7 would become www.page.com/flipbook/7/
The problem was SEO Yoast was automatically writing the tag:
<meta property="og:url" content="www.page.com/flipbook/">
So Facebook was reading this and not the parameter.

FB Like button unlikes itself

Recently facebook rolled out some changes which have apparently broken like button functionality on on pages I'm working on, particularly for urls that point to a photo (photoset) on facebook, e.g. a facebook button like
<fb:like href="http://www.facebook.com/photo.php?fbid=ID&set=SET" ....></fb:like>
The button renders, however when I click 'like' it immediately 'unlikes' itself afterwards. *Non-facebook URLs work fine with the like button, only URLs that point to photos/content on facebook cause the like button to immediately unlike itself after it's clicked. The buttons are generated via the JSSDK as iframes. Is there a solution to this problem? We're not using og metadata.
Facebook like buttons strips all the get parameters of urls, so although you have this
<fb:like href="http://www.facebook.com/photo.php?fbid=ID&set=SET" ....></fb:like>
The url retrieved by facebook is this
<fb:like href="http://www.facebook.com/photo.php" ....></fb:like>
EDIT
As you may have not noticed on the 10th of july one of the break changes is the url of the social plugins
Social plugins will require an absolute URL in the 'href' parameter
Social plugins, such as the Like Box and Like Button, will require an
absolute URL in the 'href' parameter.
https://developers.facebook.com/roadmap/#q4_2013
I've always encountered issues with using Facebook's developer tools with resources on its own domain and, for that reason, always recommended "proxying". In other words, you would create a unique resource on your web server to represent the Facebook photo, this resource would garner likes and shares, but when a user visited the page, they would be redirected to the real photo.
For example:
<fb:like href="http://www.example.com/fakeresources/photo.php?fbid=ID&set=SET" ....></fb:like>
When you load http://www.example.com/fakeresources/photo.php?fbid=ID&set=SET:
<meta property="og:title" content="The Rock" />
<script>top.location.href="http://www.facebook.com/photo.php?fbid=ID&set=SET";</script>
Unfortunately, for the og:image tag, you will also need to create a proxy, because the Facebook scraper will often not fetch from its own servers.
I've even encountered times when Facebook will not fetch from a URL because the URL has a query parameter which looks like a URL which is on its own servers, for example:
http://www.example.com/fakeresources?url=facebook.com/photo.php?fbid=ID&set=SET
(query parameter not url-encoded for readability)
For which, encoding the URL with rot-13 is sufficient.

Like button for Facebook page shows generic Facebook description in News Feed

I want a Like button on my web site that Likes my Facebook profile (rather than my web page), so that when a user clicks it they subscribe to my Facebook posts.
I've created the Like button using the tool at https://developers.facebook.com/docs/reference/plugins/like/
Further down that page there is an FAQ entry:
Can I link the Like button to my Facebook page?
Yes. Simply specify the URL of your Facebook page in the href
parameter of the button.
So, I've edited the href parameter to point to my Facebook page. eg:
https://www.facebook.com/myfacebookid
When a user clicks the Like button it has the desired effect. The user ends up having Liked my Facebook page. This is easily verified by the user going to my Facebook profile and checking that the Like button has changed to Liked.
But. When the user clicks the Like button, and entry appears in their News Feed with a generic Facebook description. ie:
Facebook is a social utility that connects people with friends and
others who work, study and live around them. People use Facebook to
keep up with friends, upload an unlimited number of photos, post links
and videos, and learn more about the people they meet.
I don't want a generic post about Facebook to appear. I want the description to relate to my Facebook account and/or web site.
Normally, I could modify this behavior with the Opengraph og: description tag, but as the page in the href is a Facebook page and not my own, I can't control the Opengraph tags.
I'm pretty sure that this was working okay before I enabled timeline for my account, so maybe this is a timeline bug?
So, how do I add a Like button which a) Likes my Facebook profile rather than one of my own web pages, and b) Posts a description of my Facebook profile rather than give a generic Facbook description?
Are all your fields in the info part of your page filled in, and/or completed? I just tested your theory and it seemed to work as expected, only thing is I know all fields in "info" are filled it. Give that a try.
This may happen if you have filled invalid/incomplete/wrong og tags in past and later changed them. Facebook's cache creates problem sometime.
Try putting all the entries (i.e. all og tags) and then debug them here http://developers.facebook.com/tools/debug. This debugger gives a detailed info about the url with og tags and also clears the cache for you.
This should solve the problem.
You have 3 important fields that used on page opengraph: Name,Description,Profile Image.
They are used when some one post your link on Facebook, or Google or some else web service that handle opengraph.
Actually, the suggested answers currently do not work and there is an open bug / ticket on Facebook for it. Up to now, there's no fix.
The problem is that you can not use simply https://www.facebook.com/myfacebookid. You should copy and paste the exact page URL. If you have a low number of likes it would look something like https://www.facebook.com/pages/[YourPageName]/[Your page Id]/, and this is the URL that you should use at this point.
If it does not work, try also https://www.facebook.com/[YourPageName]/[Your page Id]/.
In short, copy-paste the URL, do not type it manually.

Is it possible to combine a facebook page and a website in the social graph?

Facebook has "pages" for many things, like people, companies, etc. But it also has this open graph protocol. My company already has a web site, and we also have a facebook page (i.e. http://www.facebook.com/company)
People can "like" either one. We use a like iframe on the company website that refers to the website URL. I'd like to know if they can be connected such that when someone likes our facebook page, they really like our company's web site.
Or are these always going to be considered two different things?
To elaborate on puffpio's answer, you can have a like button for your existing page on you website by using the existing page's facebook url as the href parameter.
It is essential that you do not put a like button to your url if you do not want your likes split between the two. In this scenario there is no reason to have an open graph object for your page other than to provide correct data when a user shares your url in their feed. It's important to note that these shares also count towards the counter on the like button and as far as I know there is no way to recover them.
You can also use this url as your og:url tag however this will cause the linter to throw errors since the domains do not match.
No. Page and website is something different and you can't force user to like both
They are different things, but a workaround is that the like button on the company's website can be a like button for their page on Facebook with a caveat like 'Like us on Facebook' or something

Using Open Graph Protocol to Link Site with Facebook Page

I have a website at http://www.mydomain.com which has a corresponding facebook page at https://www.facebook.com/pages/mydomain/123456789.
I am looking for a way to integrate this facebook page URL into the open graph headers so that when someone shares my page, it actually shares the Facebook page instead of the site's URL.
Is this possible?
You can now do this by setting the og:url meta tag to the url of your Facebook page. Keep in mind that if you do this, other networks that use Open Graph tags will probably share your Facebook page instead of the site's url, so make sure that's what you want.
<meta property="og:url" content="http://www.facebook.com/your-page"/>
Perhaps you already figured this out as this is an old question, but since I stumbled upon it... If I understand your question correctly, you do not even need the ogp meta tags to accomplish what you want to do. All you need to do is go to http://developers.facebook.com/docs/reference/plugins/like/ and input your facebook page url in "url to like", https://www.facebook.com/pages/mydomain/123456789 from your example. Then select the options you want including the "send" button. Then get the code and paste it where you want it in your website. Now whenever someone clicks "like" on your website or clicks "send" to share your website, they will actually be liking or sending the url to your Facebook page and not your website. Is that what you were looking for?