Facebook Open Graph API - og: meta tags ignored

I was looking for a problem when the page title and image are not included in facebook. Once in the OG debugger, it looks like none of the og: meta tags are accessible via facebook:

Here is a link to the debugger - it says that it displays the og:url and og:title properties that are present on the page.

As a result of testing, I copied the meta tags and HTML scheme directly from the example in the developer docs, and I still get the same warnings.

Here is the HTML and the beginning of the main tag as generated:

 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title>123-ABC Butterfly Fun Carpet 3'10" x 5'5" Rectangle</title> <meta name="description" content="Transactiv Products" /> <meta name="title" content="Transactiv" /> <meta property="fb:app_id" content="289501899130" /> <meta property="og:site_name" content="Transactiv InRecv" /> <meta property="og:url" content="http://localhost:2609/Pages/ProductSummary.aspx?OrganizationProductID=617c54a0-189a-48af-9b5e-002148210208&StoreID=a1d6bc99-9a6a-4e46-bdb4-790be4e59bd4&ProductID=d6748a89-41f4-48aa-a1c1-5c28f87cc47f&PageName=MHMTest&PageID=236549899706529" /> <meta property="og:title" content="123-ABC Butterfly Fun Carpet 3'10" x 5'5" Rectangle" /> <meta property="og:type" content="website" /> <meta property="og:description" content="" /> <meta property="og:image" content="http://transactivazureprod.blob.core.windows.net/pictureblob/831a4d4a-dbe3-44f5-9ff8-12286cdc33f5" /> 

Any ideas on this?

+7
source share
4 answers

Facebook reads all the properties that you can enter in your URL: https://developers.facebook.com/tools/debug

Facebook will read the properties you specified, but sometimes it will only use them when all 4 are defined (and not empty), and not just the last 3 .

 <meta property="og:url" content="YOUR_URL" /> <meta property="og:title" content="YOUR_TITLE" /> <meta property="og:description" content="YOUR_DESCRIPTION" /> <meta property="og:image" content="YOUR_IMAGE" /> 
+6
source

The obvious flaw. You will not miss the end of the name. You have one. "

I would suggest doing str_replace('"', "''", $str) before its echoed message.

I.e

<meta property="og:title" content="123-ABC Butterfly Fun Carpet 3'10" x 5'5" Rectangle" />

to

<meta property="og:title" content="123-ABC Butterfly Fun Carpet 3'10'' x 5'5'' Rectangle" />

EDIT:

You may also consider making htmlentities($str, ENT_QUOTES) , as suggested by @TwoWholeWorms,

+5
source

Facebook scraper sees an error page when trying to visit your site .

You can access the Facebook scraper on your pages using the β€œSee what our scraper sees” link at the bottom of the debug page.

Also, this is not just a scraper issue, as I also see the same message when visiting the link: http://transactivstaging.cloudapp.net:8080/Pages/ProductSummary.aspx?OrganizationProductID=617c54a0-189a-48af-9b5e- 002148210208 & StoreID = a1d6bc99-9a6a-4e46-bdb4-790be4e59bd4 & ProductID = d6748a89-41f4-48aa-a1c1-5c28f87cc47f & FBUserId = 100002152993326 & PageName = MHMage65 & 99N65899 & 99N65899 & 99N65 = 29H65T49899 & 99N65899 & 99N65 = 99H65T49899 & 99N65 = 99H65T49899 & 99N65 = 99H65T49899 & 29N65 = 99H65T49899 & 99N65 = 99H65T49899 & 99N65 = 99H65T49899 & 99N65 = 99H65T49899 & 99N6565949 & 99N65 = 99H65T49899 & 99N65 = 29H65T498998998 & 9N65659;

 ShoppingCart.GetShoppingCartItems.Failed If this Error persists, you can contact our support and provide the following Error Id as a reference 
+1
source

I would suggest that, as well as " in the names mentioned by Robin Castlin (which you could also avoid as &quot; ), this is your og:url contains unshielded ampersands.

Does it work if you replace & with &amp; in this field og:url ?

So you replaced

 <meta property="og:title" content="123-ABC Butterfly Fun Carpet 3'10" x 5'5" Rectangle" /> <meta property="og:url" content="http://localhost:2609/Pages/ProductSummary.aspx? OrganizationProductID= ... &StoreID= ..." /> 

to

 <meta property="og:title" content="123-ABC Butterfly Fun Carpet 3'10&quot; x 5'5&quot; Rectangle" /> <meta property="og:url" content="http://localhost:2609/Pages/ProductSummary.aspx? OrganizationProductID= ... &amp;StoreID= ..." /> 

to ensure that all metadata contains valid HTML.

0
source

All Articles