I added the facebook share button within an email body (.htm). The purpose of the button is to share the photo a user received in his email. When the button is clicked, a new tab opens with the "Write a message" area to share on facebook.
The problem is that once "Share Link" button is clicked nothing happens - no confirmation, no redirect, BUT the link is actually posted on Facebook (so the end user would not know the message has been shared unless they check their Facebook while all confused). Here is the code for the button:
<a title="Share this photo"
href="http://www.facebook.com/sharer.php?
s=100
&p[url]=%PHOTO_LINK%.jpg (dynamically populated link)
&p[title]=Check out my pic!"
target="_blank">
<img src="someplace.png"
alt="Share on Facebook" height="50" width="50" />
</a>
I have tried using meta tags (title/description/url and the main namespace tag), but they are not picked up when shared (title/description is a bunch of random characters). Is this behaviour normal for share buttons of this sort, is it a bug or am I doing something wrong?
Thanks in advance
To fix this, put target="_blank" in the <a> tag.
You won't be able to share a photo within an email as it would mean sharing the URL to the email itself (which users won't have access to).
Instead, you should put the image on a website and use OpenGraph markup to give it a correct title, description, and thumbnail image. And then share the URL to this image on Facebook. You can still embed the image in the email, but the sharing and image need to be external from the email.
A lot has happened since 2012. There are now two API's a user may choose from when sharing on Facebook: 1) Sharer, and 2) Share Dialog.
Sharer: This will require confirmation of the user posting their content, and this will then get you what you want. However, Sharer only supports the url parameter now. There is basically no way to share any other parameter. Official Facebook Developer Docs: Share Button. And: Official Facebook Discontinuation of Sharer Non-URL Args Post.
Share Dialog: You will need to configure an App with Facebook, authenticate, and then to solve your problem, you'll want to set one of these params...
display : Set this to page (the default), or one of the other options, to determine how your share dialog displays.
redirect_uri : If you don't like how Facebook decides to interpret your display params, you can just redirect after sharing to some page on your site that says, "Post successfully shared! link to post" or some such.
Hope this helps someone.
Related
I don't see the answer I'm looking for, so hopefully someone can help.
I have a PHP script, which displays data from an SQL database. The dynamic elements are pulled in, essentially showing details of a job listing. On this page, I have a Facebook share URL.
Example:
<a title="Post on Facebook"
href="http://www.facebook.com/share.php?u=http://www.mywebsite.com/joblisting/details.php?job_id=1345488636.3750">
POST ON FACEBOOK
</a>
When the user clicks that link, they get the Facebook page to post this to their Facebook page. The page they are on pre-populates with my page title, page description, etc.
And if I have an image on my page, that becomes the default thumbnail image for the FB post. I also set a defualt Facebook image in my metatag, and that works too. I also added up to 10 other images on my page, so that the user could choose from 1 of 10 images as the default thumbnail. But...
I wanted to be able to let the user choose a thumbnail image from their desktop. Is this possible?
The image that's used in the Share dialog needs to exist somewhere on the web before the dialog is invoked, so you'd need to allow the user to upload it somewhere before popping the dialog in order to do what you're suggesting.
I have web page which needs users to sign-in (not FB signin though), and need to add share button to it. Issue is when I share that page, it only posts link to the wall. og image and og:description tags are ignored.
btw i am using iframe to show fb:like
Can you please let me know how to solve this issue?
You need to generate open graph tags even when user is not logged in.
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.
I have added a facebook share link to my sharepoint site using:
<a name="fb_share"></a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"
type="text/javascript">
</script>
I have added the script to the masterpage and the link to the page layout. I all works fine apart from that when a new page is created using the masterpage with the script some of the editong tools are disabled. For example the Format and Markup Style Menus are disabled. Can this be problem be solved?
You might want to take a look at this link :
https://developers.facebook.com/docs/plugins/
It contains all the official Facebook plugins that you can embed into your site. In your case you should look in specific at the Send Button.
The Send Button allows users to easily send content to their friends.
People will have the option to send your URL in a message to their
Facebook friends, to the group wall of one of their Facebook groups,
and as an email to any email address. While the Like Button allows
users to share content with all of their friends, the Send Button
allows them to send a private message to just a few friends.
The message will include a link to the URL specified in the send
button, along with a title, image, and short description of the link.
You can specify what is shown for the title, image, and description by
using Open Graph meta tags.
It is very easy to implement these plugins - usually a case of "copy-and-paste". It looks to me that you have been using an outdated method of the Facebook share feature.
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?