15

I have added schema.org tags in JSON LD format using <script>, when I test my page using Google structured data testing tool, I can see all my tags.

But, when I installed Facebook pixel helper chrome extension to test my page, schema.org tags were shown as blank. Not sure why Facebook pixel helper is not able to detect it.

Would appreciate any help.

Chirag Swadia
  • 1,099
  • 1
  • 9
  • 24
  • I’m not familiar with Facebook Pixel. How is it related to Schema.org? Why would the Chrome extension show the Schema.org/JSON-LD to begin with? – unor Jul 28 '18 at 03:01
  • Chrome shows me: "[Facebook Pixel] - Unable to parse JSON-LD tag. Malformed JSON found:" – Joe Barrett Oct 09 '18 at 18:32
  • Hi I have the same problem any solution ? – Pascual Muñoz Nov 06 '18 at 23:12
  • In my case, our php framework was spitting CDATA in the script but Facebook does not like it... – aleksdj Jun 19 '19 at 14:39
  • I have FAQ structured data and getting similar warnings, any solutions? This is strange coz FB doesn't support FAQ structured data and still I can see Warnings in Chrome Developer Tools. – Bhargav Joshi Jan 02 '20 at 03:44

5 Answers5

9

I found that Facebook Pixel is more strict in its parsing of structured data. Blank line feeds in fields will cause it to throw up warnings. This occurred to me when I had line feeds in an address. The address was correctly interpreted by google, but Facebook Pixel put up warnings in the console.

Adding the following code resolved it in my case:

$address = preg_replace( "/\r|\n/", " ", $address );

Of course, as pointed out here JSON doesn't support real line-breaks.

danlynn
  • 143
  • 1
  • 5
3

Late for the party, but still for people who come here. FB pixel now supports JSON-LD: https://www.facebook.com/business/help/1175004275966513

heorhi
  • 370
  • 2
  • 11
3

For me, there was an error in multiple spaces (as I understand it).
Therefore, I use this code:

$description = preg_replace("#\r|\n|(\s+)#iu", " ", $description);
Nikos Hidalgo
  • 3,666
  • 9
  • 25
  • 39
0

The JSON extension also adds Schema markup in JSON-LD format for all other webpages, which Google prefers. “Facebook pixel” does not read Schema meta tags or JSON-LD (Pinterest reads Schema meta tags, but not JSON-LD – yet).

It sounds like you may be a bit confused – Facebook does not read Schema markup – Facebook reads Open Graph meta tags. You can find details of the standard here: http://ogp.me/.

FYI https://www.withintheflow.com/facebook-pixel-helper/

  • 1
    I think it is not whole true. In Facebook documentary I found that Pixel reads OpenGraph and Schema.org. Important question is: if reads Schema markup in JSON-LD format ? – Geery.S Aug 19 '18 at 12:46
  • Late for the party, but still for people who come here. FB pixel now supports JSON-LD: https://www.facebook.com/business/help/1175004275966513 – heorhi Jan 25 '19 at 10:39
0

You might happen to have fbq('set', 'autoConfig', 'false') in the init call.

The Facebook pixel will send metadata to your pixel setup but in the init code if you have autoConfig set to false, Facebook Pixel will not send this additional information.

VegaStudios
  • 378
  • 1
  • 4
  • 22