Open Graph Protocol
The Open Graph Protocol is a set of metadata that allows easy inclusion of any of your webpage (object) into a social graph social network such as Facebook.
Required Metadata
- og:title
The title of the object.
<meta property="og:title" content="del" />- og:type
The type of the object.
<meta property="og:type" content="blog" />Below is the list of all permissible og:type grouped by category:
- Activities
- activity
- sport
- Businesses
- bar
- company
- cafe
- hotel
- restaurant
- Groups
- cause
- sports_league
- sports_team
- Organizations
- band
- government
- non_profit
- school
- university
- People
- actor
- athlete
- author
- director
- musician
- politician
- public_figure
- Places
- city
- country
- landmark
- state_province
- Products and Entertainment
- album
- book
- drink
- food
- game
- movie
- product
- song
- tv_show
- Websites
- article
- blog
- website
Use blog and website for your website’s root document and article for content that does not fall in any other category.
- og:image
The URL of the image that represent the object.
<meta property="og:image" content="http://delrosario.mobi/delrosario.mobi.png" />- og:url
The canonical URL of your object that will be used as its permanent ID in the graph.
<meta property="og:url" content="http://delrosario.mobi/" />
Optional Metadata
- og:site_name
The name of your website.
<meta property="og:site_name" content="del" />- og:description
The description of the object.
<meta property="og:description" content="has a blog." />- og:upc
The UPC of the object. UPC is a 12-digit barcode that uniquely identifies a product or service.
Below is an example using the UPC of the Amazon Kindle.
<meta property="og:upc" content="892685001003" />- og:isbn
The ISBN of the object. ISBN is a 10 or 13 digit barcode that uniquely identifies a book.
Below is an example using the ISBN of J.K Rowling’s Harry Potter and the Sorcerer’s Stone book.
<meta property="og:isbn" content="0590353403" />
The UPC and ISBN are only recommended to be used if your object’s type is in the category Products and Entertainment.
Location
You can either enter in GPS or an Address or both. We’ll use Grauman’s Chinese Theater as an example.
GPS
- og:latitude
The latitude of the object in decimal format.
<meta property="og:latitude" content="34.10178" />- og:longitude
The longitude of the object in decimal format.
<meta property="og:longitude" content="-118.340969" />
Location
- og:street-address
The street address of the object.
<meta property="og:street-address" content="6925 Hollywood Blvd" />- og:locality
The city.
<meta property="og:locality" content="Los Angeles" />- og:region
State, province or region of the object.
<meta property="og:region" content="CA" />- og:postal-code
The postal code of the object.
<meta property="og:postal-code" content="90028" />- og:country-name
The three letter country code of the object.
<meta property="og:country-name" content="USA" />
Contact Information
- og:email
The email of the object
- og:phone_number
The phone number of the object.
- og:fax_number
The fax number of the object
Markup
Below are sample markups with doctype and namespace.
- XHTML5
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/"> <head> <title>del</title> <meta property="og:title" content="del" /> <meta property="og:type" content="blog" /> <meta property="og:url" content="http://delrosario.mobi/" /> <meta property="og:image" content="http://delrosario.mobi/delrosario.mobi.png" /> </head> <body> </body> </html>XHTML5 currently does not validate.
- HTML5
<!DOCTYPE html> <html> <head> <title>del</title> <meta property="og:title" content="del" /> <meta property="og:type" content="blog" /> <meta property="og:url" content="http://delrosario.mobi/" /> <meta property="og:image" content="http://delrosario.mobi/delrosario.mobi.png" /> </head> <body> </body> </html>HTML5 currently does not validate.
- XHTML
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/"> <head> <title>del</title> <meta property="og:title" content="del" /> <meta property="og:type" content="blog" /> <meta property="og:url" content="http://delrosario.mobi/" /> <meta property="og:image" content="http://delrosario.mobi/delrosario.mobi.png" /> </head> <body> </body> </html>- HTML4
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML4+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/html4-rdfa-1.dtd"> <html> <head> <title>del</title> <meta property="og:title" content="del"> <meta property="og:type" content="blog"> <meta property="og:url" content="http://delrosario.mobi/"> <meta property="og:image" content="http://delrosario.mobi/delrosario.mobi.png"> </head> <body> </body> </html>