Open Graph protocol should be integrated

by balexandre   Last Updated September 11, 2019 20:24 PM

In order for a better experience when sharing a link over Facebook (and not only there) it would be nice to have the Open Graph protocol in a page.

For example for https://bicycles.stackexchange.com/:

<meta property="og:title" content="Bicycles - Stack Exchange"/>
<meta property="og:type" content="forum"/>
<meta property="og:url" content="https://bicycles.stackexchange.com/"/>
<meta property="og:image" content="http://cdn.sstatic.net/bicycles/img/logo.png?v=123"/>
<meta property="og:site_name" content="Bicycles - Stack Exchange"/>
<meta property="og:description"
      content="Q&A for people who build and repair bicycles, 
               people who train cycling, or commute on bicycles"/>


Answers 2


My question would be... to add what? Most of that data is already available via regular html, and it doesn't do too badly:

facebook

adding an image... well, that's interesting because we do do that for apple-touch etc:

<link rel="apple-touch-icon"
    href="/content/stackoverflowmeta/img/apple-touch-icon.png">

so it wouldn't seem reasonable to advertise the logo that we share on stackauth:

logo

(or possibly the first image in the markdown? defaulting to site logo?)

but the rest seems a bit redundant? Of course, there is a reasonable number of iOS users, where-as facebook links would be much rarer. I wonder if there is any way to detect if the caller might be interested in the open-graph data, i.e. add it when it might help (so: for facebook's servers calling us)

Edit: and here's bicycles:

enter image description here

Which could potentially have additionally the logo:

bicycles

Marc Gravell
Marc Gravell
September 08, 2011 08:55 AM

I don’t know when it happened, but Stack Exchange sites now use the Open Graph vocabulary.

Previously specified in HTML5 meta tags, which was invalid, but at some time after 2014-02 via RDFa.

This very question, for example, uses RDFa in the head (I have removed the unrelated HTML5 and Microdata attributes):

<meta property="og:type" content="website" />
<meta property="og:image" content="/content/stackexchangemeta/img/[email protected]?v=c34d758b103d" />
<meta property="og:title" content="Open Graph protocol should be integrated" />
<meta property="og:description" content="In order for a better experience when sharing a link over Facebook (and not only there) it would be nice to have the open graph protocol in a page for example for http://bicycles.stackexchange.com..." />
<meta property="og:url" content="https://meta.stackexchange.com/questions/105487/open-graph-protocol-should-be-integrated"/>

As they don’t define the prefix og, the RDFa Core Initial Context gets used where og has the URI http://ogp.me/ns#, so it’s the Open Graph protocol.

unor
unor
January 17, 2015 04:42 AM

Related Questions



Facebook login on Android , iOs and Web

Updated October 24, 2017 09:24 AM


How to contact Facebook Developer Support?

Updated July 26, 2018 04:24 AM

Unlink Facebook Login for Stack Exchange profile

Updated November 19, 2018 06:24 AM