1

I'm using Google's Structured Data Testing Tool to investigate why Google isn't finding any structured data on my page.

On first loading the URL (https://www.languagesunited.co.uk), I get an "Uncategorised Error":

JSON-LD Missing '}' or object member name.

Within the test tool source windows, I can making a small change to the page (add a space somewhere) and re-run the validation, and it validates (except for the url needing to be www.example.com for the tool to work).

I'd be grateful for any advice if anyone has had a similar problem.

unor
  • 92,415
  • 26
  • 211
  • 360
d_a_n
  • 317
  • 7
  • 16

3 Answers3

1

After some experimenting with different options and getting different results with the test tool, the answer was very simple. There were some invalid whitespace characters in my structured data. Switching on the "show invisibles" option in my editor allowed me to replace these with spaces, and the data validated successfully.

d_a_n
  • 317
  • 7
  • 16
0

Both are, most likely, bugs in the SDTT.

If you paste the markup (instead of letting it fetch the URL), the SDTT detects the structured data immediately (letting it fetch first and then editing something in the detected markup is the same idea). So there’s probably something wrong with their URL fetching.

For the issue with the example domain, see these questions:

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
  • Thanks for your advice, as you say, I think my data is probably fine and it is a bug. My concern is that Google use the same fetching process when crawling the page and get the same error, but I'll just have to wait and see.. (at the moment the Search Console reports hasn't found any structured data). Thanks again, Dan. – d_a_n Feb 18 '17 at 08:20
0

I've just realized that Google Structured Data Validation Tool requires you (or us) to include context, In example:

'@context': 'https://schema.org',

(schema.org includes it in all their examples, i.e.: Example encoded as JSON-LD in a HTML script tag.

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "Person",
  "name": "Christopher Froome",
  "sponsor":
  {
    "@type": "Organization",
    "name": "Sky",
    "url": "http://www.skysports.com/"
  }
}
</script>

If you do so you will start getting results again.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Juan
  • 2,156
  • 18
  • 26