Chirag Swadia
Chirag Swadia

Reputation: 1117

Schema.org in JSON LD format recognized by Google, but Facebook pixel helper does not detect it

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.

Upvotes: 15

Views: 16223

Answers (5)

AndreyChursin
AndreyChursin

Reputation: 111

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);

Upvotes: 3

heorhi
heorhi

Reputation: 370

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

Upvotes: 3

danlynn
danlynn

Reputation: 143

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.

Upvotes: 9

VegaStudios
VegaStudios

Reputation: 324

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.

Upvotes: 0

Nitish Chauhan
Nitish Chauhan

Reputation: 73

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/

Upvotes: 0

Related Questions