Facebook Deep 'Like' - facebook

I'm working on a few e-commerce applications where I'd like users to be able to 'Like' products. It's not always possible to embed the og: meta tags on the page that's being 'Liked', either because it's not in our control, or because it's deep in an AJAX application.
I've hit upon the idea of building a proxy for OpenGraph objects. I can point the Like button to the proxy URL, which will serve up all the og: metadata describing the product, including a canonical URL.
The trouble is that Facebook follow the canonical URL and parse that for metadata, rather than the proxy page.
Is this a bug in FB's parser, or am I missing something?
I'd appreciate any help or clarification you could offer.
Thanks in advance,
Ross

If you're using the <link rel="canonical" ...> tag, maybe try to exclude it from the proxy page's source code when the user-agent of the user is the Facebook user-agent. This way, user's browsers and search engines see and recognize the canonical url, and the Facebook page crawler doesn't.

Related

Can you force Facebook to recognize correct image without og: tags?

I have a website where news articles get posted through CMS and there is no option to add Facebook META OG tags to <head>. I could only add them manually to <body> but that won't work I assume?
Is there another solution where you can tell Facebook which image should be picked when using like/share buttons?
This depends how you make the share. You can use the FB.Ui to request a "Post to a wall" where you can specify the specifics of what appears on the share.
https://developers.facebook.com/docs/reference/dialogs/feed/
If you are sharing the URL only it will read your meta tags as you state. I have not tried making that image the first within the HTML as this may also make that the default.
you can use this link to debug your meta tags and test your sharing if you are sharing a URL.
https://developers.facebook.com/tools/debug/

How to do Facebook Open Graph friendly meta tags with client-side template engines like AngularJS, Mustache, Handlebars

According to my testing, Facebook's crawlers do not render client-side templates like a browser.
I want to avoid a webserver and building HTML files for Open Graph objects at all costs. I want to generate the meta tags on the fly via the URL, but it seems Facebook cannot do this.
Can someone from Facebook please confirm? I asked the head of Open Graph at #mobiledevcon and she said that Facebook can render stuff like {{value}}
My meta tags are as follows, and they render fine in every browser. But the Facebook Open Graph Debugger only sees the raw text, not the interpolated content.
<meta property="{{meta.property}}" content="{{meta.content}}">
When you think about it it should be clear, why this does not work.
The Facebook crawler downloads the HTML as it is served by the server. The Facebook crawler will not execute any JavaScript, like all the crawler will not execute the JavaScript. This is due to security restrictions and for speed reason (they do not have the time execute JavaScript on their servers.)
There is no way around this. If you want the crawler to index you page, you need to give them directly what you want them to read.
Tip: You could use something like phantom.js to render your pages on the server side and serve this to the crawlers.
The solution is basically to use some kind of server-side user-agent detection to pick up whenever a social media crawler arrives.
Use the ?_escaped_fragment_ method along with a prerender service. Facebook will respect the same crawlable Ajax specification as Google. Please see https://developers.google.com/webmasters/ajax-crawling/docs/specification

Difference between rel="canonical" and og:url?

I'm having trouble understanding canonical URLs with regards to how search engines and Facebook seem to handle them.
My Google maps powered site allows visitors to use social media to request a gig in their country. One of the pages in question can be found at: http://izzy.nogig.in/
When a user clicks on their countries marker it gives them sharing options (twitter/facebook/etc), which when shared will share the URL specifically for that country, eg: izzy.nogig.in/usa? or izzy.nogig.in/spain? etc.
All of these countries in the URL amount to a lot of duplicate content so I use the following to point search engines to the page I want ranked:-
<link rel="canonical" href="http://izzy.nogig.in/_?"/>
For Facebook Likes to count towards each individual country I've set my Open Graph "og:url" as follows, eg:
<meta property="og:url" content="http://izzy.nogig.in/australia?" />
Now when I run a country-specific URL through the Facebook Object Debugger (eg. http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fizzy.nogig.in%2Faustralia%3F) it shows the following:-
Response Code: 206
Fetched URL: http://izzy.nogig.in/australia
Canonical URL: http://izzy.nogig.in/australia
Mismatch og:url and canonical url:
og:url tag in the header is not the same URL as rel='canonical' link in the html.
The above error is what's confusing me. I know they're mismatched, but I thought this was the correct way to do this.
Everything in the debugger looks good to me (correct link, description, image etc for each country), and I can't change the rel="canonical" value to match my og:url as I need it pointing to a single page (country-less) for search engines.
I believe it is all working correctly. Should I just ignore the error from the debugger, or have I set this up incorrectly? I don't want "likes" for each country all disappearing and counting towards the rel="canonical" URL.
Many Thanks - Will
link rel="canonical" will be used by search engines where as og:url will be used by facebook
og:url basically tells the FB scraper "ignore anything on this page, and scrape this url instead"
More for Canonical link element: http://en.wikipedia.org/wiki/Canonical_link_element
Canonical urls refer to page content.
The target (canonical) IRI MUST identify content that is either
duplicative or a superset of the content at the context (referring)
IRI. rfc6596#3
Opengraph url refers to "object".
The canonical URL of your object that will be used as its permanent ID in the graph, e.g., "http://www.imdb.com/title/tt0117500/". ogp.me
So they may be different. For example, for multi-language websites, page for each language should have distinct canonical url, because content is different, but usually the same og:url for all languages, because they refer to the same object described in multiple languages.
On one of the sites I've developed I serve the page in more than one language, and provide links to allow the user to switch between one language and the other. So, my rel="canonical" will have the URL http://www.example.com/, whereas, within the code I update the og:url so that it is either http://en.example.com/ or http://fr.example.com/. That way when the user shares the page on Facebook, everything will appear on Facebook in the language they were viewing the page, which makes sense since most of the visitor's friends will likely speak the same language.
Regards.
I see no reason why og:url and canonical should be different. In both circumstances you're saying to either the search engine or Facebook what page you want to index or be displayed.

Wordpress issue: get extra html tags appear when I paste url into facebook page

When I paste a friend's wordpress site url in a facebook comment, I see the following extra text (I've changed the url for anonymity) The home page of the wordpress blog is titled "Home"
For some reason facebook adds the extra lines in i.e. where it says "You may use these HTML tags and ... " or perhaps the wordpress generated html get incorrectly parsed/referenced in the facebook comments browser.
I have zero wordpress experience but do understand CMS concepts well. Any help on how to resolve this will be much appreciated by my friend. I can disclose the url if its really needed to resolve the issue. I decided to try posting the question with an anonymous url first, just in case this is a known, encountered-before issue.
Wondering if the facebook graph-api has anything to do with this? (FB graph-api is not my forte either as I'm more into iOS development)
Home
http://mywordpressfoo.net/
You may use these HTML tags and attributes:
<​a href="" title=""> <​abbr title=""> <​acronym title="">
<​b> <​blockquote cite=""> <​cite> <​code> <​del datetime="">
<​em> <​i> <​q cite=""> <​strike> <​strong>
It sounds like your friend's blog does not have OpenGraph tags. Facebook uses these to determine how URLs display when posted on their site (e.g. YouTube URLs display embedded videos, Flickr URLs photos, etc.).
You can find more information about the metatags that Facebook supports in their OpenGraph documentation. Your friend will probably want to make individual posts "Articles", while the homepage should be a "Blog" or a "Website".
Depending on your friend's competency with editing WordPress templates, they might find it easier to integrate Facebook's official WordPress plugin, which includes support for OpenGraph tags.

Facebook open graph on a domain with url masking and wordpress

im using wordpress on my web site and im having problems posting articles on facebook.
for every article i post i always get the same og title and og url. this is cleary a url masking issue as my meta tags cannot change even if i settled them on wordpress header.php.
here is the website.
http://carnagenews.com/
anyone can help me?
basically i want dynamic og title/url/description/image avoiding that the url cloaking always output the same meta tag
thanks guys!
There is couple of issue with your site:
Your site on http://carnagenews.com/ is just a top-level frame wrapping http://carnageweb.altervista.org/ which Facebook will not follow with linter and will not populate your OpenGraph data with correct details until OpenGraph meta exists at the URL specified by og:url meta tag.
Your real pages result in 404 response code for Facebook Linter (check for yourself using Debug Tool).