Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 962
Chirag Swadia Avatar asked Jul 27 '18 12:07

Chirag Swadia


People also ask

Does Google use JSON-LD?

Google prefers JSON-LD for web content. See JSON-LD for more information. Microdata: Uses attributes in HTML tags to define data.

Why is my Facebook pixel not working?

There could be an error in your pixel base code. If this is the case, you can try deleting the Facebook pixel code you've placed on your website and adding the code again.

How do I make sure my Facebook pixel is working?

In order to check to see if your Facebook Pixel is firing properly, you'll want to use the Google Chrome browser. You can then install the Facebook Pixel Helper Chrome Extension, which is basically a tool that will show you if it detects a pixel on your website. You can download the Facebook Pixel Helper here.

How do I know if my meta pixel is working?

When a website has a Meta Pixel installed, the Pixel Helper icon turns blue and a small badge will appear indicating the number of Pixels found on the webpage. If the icon does not turn blue, no Meta Pixels are installed on this webpage.


1 Answers

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.

like image 169
danlynn Avatar answered Oct 04 '22 00:10

danlynn