Working with Facebook like API and opengraph - facebook

The Documentation from facebook isn't understandable, atleast for me.
I have never worked before with facebook and had a basic requirement of putting a like button on Product pages.
So yesterday, I added the OpenGraph meta tags and like button to my Product pages as stated in this documentation, https://developers.facebook.com/docs/opengraph/. I also created an app, as the document stated that it has extended the basic meta data to add a required field to connect your webpage with Facebook: fb:app_id.
The like button has been set but i have few queries which are as following :-
For some pages, the like button doesn't read the og tags. Rather than publishing the whole thing in a story manner by reading og tags, it just shows a link. During googling, I read it happens because of facebook caching and since, I shared the link on facebook before putting the meta-tags, this is happening. So, Is there any way that I can direct facebook to reset all the caching for my pages or scraping that it has done earlier.
Though I have created the App, I actually have no idea what to do with it. Why is it needed and what matters it can help me with.
I tested one of my URLs here: Facebook Linter but it shows some error and stuff which i can't understand. Below is the image. Please tell if I have done anything wrong and why it's showing these errors

Documentation for OpenGraph on Facebook containing outdated information about pre-defined types, see OpenGraph Types. You probably need to define your custom Object Type "Product" in for your Application/Site using Developer Application in Open Graph settings.
You may want to read Documentation for OpenGraph beta too.
Update:
There is a similar question about exactly this og:type: Opengraph meta tag og:type set to “product” errors (like button & URL linter/debug)

Related

How to customise Facebook shares

I've successfully added a Share button to my website using the following code:
https://developers.facebook.com/docs/plugins/share-button
It produces a popup with a link to the og:url along with the title of the linked page and a picture from it, which I can then post, and it shows up on my Facebook.
I am having 3 issues with this:
I've update the og:url and data-href after page load, using jquery, but the new values get ignored when I Share.
the og:title, og:description, and og:image don't appear to be used at all.
Sometimes I'd like to Share some custom text (and images if possible) without any url.
I'm aware that Facebook provide other tools/APIs that provide more versatility but it seems that would mean my site would have to go through a review process, and I'd have to code for security. This is not an option and I want to stick to the popup method.
Hope someone can help. Many thanks.
If the tags do not change when posting, refresh (and test) the tags in the debugger: https://developers.facebook.com/tools/debug/sharing/
Dynamically created Open Graph tags (with JavaScript) will be ignored, the tags have to be in the original page source.

Facebook Video Posts with the same OG tags looks different

Facebook seems to change things fast.. All existing questions I have seen are older than facebooks "big image" posts, that this question is (partially) related to.
I'm testing Facebook interaction by including meta tags in my page to add a YouTube player as og:video on a page on my site.
All OG tags validate and I can successfully post links and get the video embeded. The problem I get is that while both the Facebook OG Debug Tool and the post does understand the title and description of the page, the post seems to behave strangely when played compared to a youtube link.
Look at the differences here: http://imgur.com/a/kOvkk
I have tried all combinations and order of OG tags I can think of, but I cannot seem to get the same result from my page link as I get from the YouTube link. And since the Facebook Debugger Sees the exact same values, I can not see how they are interpreted so differently..?
Here is the OG Debugger Comparison: http://i.imgur.com/dqok8aG.png
Has anyone else experienced this, or is familiar with the inner workings of Facebook?
The pages used to test are these, although the one on my site might have changed when you read this.
Solved it! The behaviour is triggered by the size of the og-image, and even if I still cannot understand why the youtube link behaves differently with the exact same image url, I can workaround it by manually setting a smaller og:image.
Result: http://i.imgur.com/g5pIN2b.png

Facebook Like/Share (Mostly) not working on my Wordpress blog

Facebook LIKE/SHARE functions are generally not working on my wordpress blog. I cannot LIKE or SHARE any new posts, but oddly if I have already LIKED a page, the SHARE function works fine.
The problem with SHARE is that the normal sharing window pops up, but there is no metadata populated in it. I've looked at the metadata in my blog posts and as best I can tell it is populated correctly by Wordpress. Additionally, I cannot find any differences in the metadata or code between posts that I have previously LIKED and ones that I have have not.
I've tried running the FB debugger/linter for a number of posts on my site and each one returns the message:
Error Linting URL: An internal error occurred while linting the URL.
I've tried googling this error, but cannot find any useful advice on what might be causing it.
Here is a sample post for people to examine this problem:
http://erb.kingdomnow.org/michael-pollan-talks-about-his-new-book-cooked-video/
Thanks...
You should use Open Graph tags (see "Use proper Open Graph tags and large images to generate great previews" and "Using Self-Hosted Objects") in the header of your webpages to help Facebook determine what metadata needs to be shared.
Since you are using WordPress, you could either edit the template file in your theme that defines page headers (normally header.php) or use Facebook's official plugin.

Metadata Fails for Blog Post Like Buttons

I'm integrating a Like button in the individual blog posts on my company's website ( www.atlas-games.com , blog by CLASSIC Blogger at http://blog.atlas-games.com ... can't use a widget). Unfortunately the metadata isn't passing through, so in Facebook it looks like:
Michelle Nephew likes a link.
Atlas Games: Charting New Realms of Imagination <--website's name, not post title
The item links work correctly on "link" and "Atlas Games ..." directing to the individual post, but it's using generic text rather than the individual post's title, the site name I specified for Facebook, and the image.
Object Debugger comes up with Inferred Property errors for URL, Title, and Image, though I specify them in the header of my page. For some reason Facebook just isn't finding the metadata, seems like. See the report here:
http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fblog.atlas-games.com%2F
I'm having trouble posting my code here ... View Source, though, and you'll see the Meta Property tags in the header and the iframe in the post's footer code (commented out right now).
This is the third time over the course of several months that I've spent hours trying to get this to work, with no luck, so it's not a temporary issue. Any suggestions?
It seems like the structure of the HTML might be the issue as it could be stopping Facebook finding the Open Graph tags.
Fixing these validation errors might allow the tags to be parsed:
http://validator.w3.org/check?uri=http%3A%2F%2Fblog.atlas-games.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0
Also there are some template variables in the OG tags which aren't being replaced with values:
<meta property="og:title" content="<$BlogItemTitle$>" />
I have the same problem on my blog! And I can't even insert html for the facebook like button directly from facebook developers, into my blog, my blogger blog tells me that the html is erred. I think it has something to do with blogger being a google blog and google now having google+. I noticed all my problems began when google+ came out, I think google is possibly screwing up the facebook like buttons on google sites, to gain monopoly through "share on google+" .

Why is Facebook returning the wrong page (affects Facebook Like and Share URL)?

When we first put up a blog post, Facebook often (but not always) gets confused about what the page is. Specifically, if you try to use the Like button on the blog page OR if you try to share via the Share link on your profile, Facebook will see the root blog page rather than the actual post page.
For example, we recently posted:
http://thisorthat.com/blog/2010-song-of-the-year-round-1-results
If the user "likes" it, it returns the title for:
"http://thisorthat.com/blog"
When you run the post URL through the FB Linter, you can see the problem.
"http://developers.facebook.com/tools/linter?url=http://thisorthat.com/blog/2010-song-of-the-year-round-1-results"
In the Debug section it shows an extra og:title, og:url, description and og:image (the last 4 rows of the Debug section). This is the meta data from the root directory. What we cannot figure out is why. Why is Facebook seeing the correct meta data on the page and then also pulling the meta data from the root directory (and using that incorrectly to populate the data for the Like button and the Share URL tool)?
One other oddity. FB "figures it out" after a few days. Of course, by that time relatively few people are viewing the post.
UPDATE -- I want to thank Peter Bailey again for his answer, but we also discovered that there was another issue that we had to resolve before the Like button worked.
The issue was that we were displaying the Facebook the Like button on a post that was not yet published. The problem with this is that FB then can't resolve the URL and "guesses" as to the correct URL. In our case, it always guesses thisorthat.com/blog. Unfortunately, it then caches that guess for a number of days and that cache cannot be cleared by the Linter. So the ultimate solution was to both fix the og:type as Peter suggested, but also to remove the Like button from the blog post preview. It's very important that you don't show FB a page before it's published or if you do, change the URL.
Pretty sure it's your Open Graph type that's the problem.
<meta content="website" property="og:type"/>
Per the documentation
Use article for any URL that
represents transient content - such as
a news article, blog post, photo,
video, etc. Do not use website for
this purpose. website and blog are
designed to represent an entire site,
an og:type tag with types website or
blog should usually only appear on the
root of a domain.