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

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.

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.

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

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

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/

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.

Related

Link query strings get cut off

I'm not aware of link designing strategies, so I am not sure why my link gets chopped off when someone clicks on from sources like Facebook etc.
I have a 'share feature' on my platform, which lets a user create a link to their listing and share it with people.
The link I generate for the listing in my backend has parameters, which reads the listing id and the type and displays content over HTML
Here's a sample link for a listing
https://www.fayvors.com/Share.html?hash=5eccccaa-7b8d-42bd-af8c-08d50da0c867?type=lessons/
However, when I share the link on facebook and click it, the browser redirects to a link that's cut off
https://www.fayvors.com/Share.html?hash=5eccccaa-7b8d-42bd-af8c-08d50da0c867%3Ftype%3Dlessons
I'm not aware of link designing principles, so I'm a bit lost here!
Thanks!
Your URL contains “special characters” (like a second question mark inside the query string), but you neglected to apply proper URL encoding when putting this URL as a parameter value into another URL:
javascript:window.location.replace('https://www.facebook.com/sharer/sharer.php?u='+window.location)
Use encodeURIComponent on the value you are concatenating to the sharer URL here.

How to retrieve page with special characters in page name

Trying to retrieve general page info using the Facebook graph API using an Jquery/Ajax call. This works flawlessly until I request a page containing special characters or dashes in it's name.
It seems like the special characters are ANSI encoded during the ajax request so the name is malformed and the page cannot be found. I can't find a way though to obviate this.
Example url: https://graph.facebook.com/Musée-de-la-Photographie-Charleroi?access_token=[my_access_token]
Can anybody help me out?
I think you should test different values in contentType parameter. It allows to set char encoding.
Take a look here:
http://api.jquery.com/jQuery.ajax/
It seems like the special characters are ANSI encoded during the ajax request so the name is malformed and the page cannot be found.
No, I don’t think that’s the problem.
As you can see from https://developers.facebook.com/tools/explorer?method=GET&path=18521449287, this page does not have a username set yet – and since it is not accessible via just www.facebook.com/Musée-de-la-Photographie-Charleroi, but only via www.facebook.com/pages/Musée-de-la-Photographie-Charleroi/18521449287 including the page id.
And accordingly, info about the page on the Graph API is only available via the page id as well.
Try using the page_id instead (in this case 131141113604635).
https://graph.facebook.com/131141113604635?access_token=[my_access_token]
You may get this id by opening the page on the browser and pressing Ctrl+U, Ctrl+F and searching for a 'page_id' value.

Facebook Graph API SEO Comments and Profanity Filter

I'm trying to integrate the Facebook comments left on our site in a way in which the content can be crawled by search engines and also for people (although I highly doubt there will be many) who don't have Javascript enabled on their browser.
Currently our Facebook comments are displayed via the use of the Facebook comment social plugin (using the <fb:comments href="MY_URL" num_posts="50" width="665"></fb:comments> tag). This ends up rendering an iFrame (which are mostly ignored by search engine crawlers) so the plan is to render this information and format it with basic HTML. To do this, the comments are pulled using the Graph API - this is then only be displayed to crawlers and people with Javascript disabled.
This all works nicely using the Graph API call (https://graph.facebook.com/comments/?ids=MY_URL), parsing the JSON result and displaying it on the page. The problem is that the <fb:comments> approach filters our results based on a blacklist we have set up on one of our Facebook Apps. The AppId with the relevant blacklist is stored on the page using metadata (<meta property="fb:app_id" content="APP_ID"/>) which the <fb:comments> control obviously must somehow use to filter the comments.
The problem is the Graph API method does not filter any results as I guess no blacklist (or App Id containing a blacklist) is specified. Does anyone know how to specify a Facebook App ID to the API call URL or of another way to not fetch commnents back that violate the terms of the blacklist?
On a side note, I know the debate about filtering content in comments rages on but it is a management decision to implement the blacklist, and one that I have no influence in changing - just incase anyone felt the need to explain the reasons why content filtering is or isn't a good idea!
Any thoughts on a solution?
Unfortunately there's no way to access a filtered list of comments using the API - it might be a reasonably request to have this in the API - you should file a wishlist item in Facebook's bug tracker
Otherwise, the only solution I can think of is to implement your own filter on your side when retrieving and displaying the comments from the API.
According to the Comments plugin documentation the filter on Facebook's side is implemented as a simple substring match, so it should be trivial to implement.
A fairly simple regular expression match should be able to check each comment against a relatively long list quickly.
(Unfortunately, the tradeoff here is that implementing a filter is easy, but you'd also need to write an interface so that whoever's updating the list of disallowed words can maintain the list for both the Facebook plugin, and your own filtering.)
Quote from docs:
The comment is checked via substring matching. This means if you blacklist the
word 'at', if the comment contains the sequence 'a' 't' anywhere it will be
marked with limited visibility; e.g. if the comment contained the words 'bat',
'hat', 'attend', etc it would be caught.
Pretty sure there is no current way of doing this from the graph API, the only thing I can suggest is taking the blacklist and build your own filter

How to set content type to html on Google Calendar api?

So reading the google calendar api (php) documentation it states:
"...content, set using setContent, provides additional information about the event which appears when the event details are requested from within Google Calendar. Optionally, the description's mime-type is set using setType to specify HTML instead of plain text. "
I've been trying to figure this out for a really long time but i have no idea how to go about setting the content to html instead of plan text. I tried using the setType method, on Zend_Gdata_Calendar object, but it said the method doesn't exist. Any ideas?
In the API there is a section that talks about "Creating web content events." That shows an example of setting the type, which is just a MIME type. For HTML, you can set the type as "text/html" and then provide the link to the HTML.
Data API Developer's Guide: PHP
From reading it, I believe this will create an iFrame that shows your content. I've been playing around with this a lot in .NET and it seems to work. I hope this helps you.

Format of External Links on Facebook

I have seen when you visit a profile on FB and click on link provided in
Contact Information --> Website
Facebook first take you to url format mentioned below
http://www.facebook.com/l.php?u=http%3A%2F%2Fwww.nwaonfire.com%2F&h=BAQByDCFo
and then takes you to the site .
My question is why facebook does so, Iam asking because there is a place in my application where iam allowing users to enter website urls.
...and the reason for facebook using the mentioned link instead of linking directly to http://www.nwaonfire.com is that facebook is evil.
They want to know which links are popular, where their users are going and where the link came from.
I also see a format as http://www.facebook.com/l/BAQByDCFo/www.nwaonfire.com where the BAQByDCFo is a hash value.
URL encoding is done so that a second URL can be placed within the first's query string without breaking the original URL. For example, implying directory structure by using the "/" character or breaking out of name value pair by using "&". If you're going to be embedding a URL as a query string parameter, you must encode it first. How you do this will differ depending on the language you're working with but most web based frameworks have a native or library based function to easily do this.