Page 1 of 3 123 LastLast
Results 1 to 10 of 30
Like Tree3Likes

Thread: JSON Schema

  1. #1
    Member Since
    Sep 2012
    Location
    Nashville, TN
    Posts
    1,072
    Thanks
    129
    Thanked 152 Times

    JSON Schema

    For those of you using JSON schema, am I correct in understanding that it outputs in the code and not physically on the website?

    If so, how would you mark up an address you have on your website? If you use JSON it looks like you would have the address marked up in the code and then have to mark up the address that renders on the site as well.

    Do you mark it up with a schema and have 2 markups? Do you just not mark up the address at all? Or do you just not use JSON?

    My schema knowledge isn't that polished so forgive me if I left any details out I shouldn't have.
    Tutelary Marketing, Owner
    Local Listing Ninja - Business Listing Service

  2. #2
    James Watt's Avatar
    James Watt is offline Top Contributor
    Member Since
    Oct 2013
    Location
    Portland, OR
    Posts
    793
    Thanks
    138
    Thanked 285 Times

    Re: JSON Schema

    So the way schema was originally implemented (as I understand it at least) was with a microdata style approach to adding meta data to content on your site. Makes sense, you have the html you want your users to see, and then you update it with meta data so that search engines can understand more information about what you're sharing with your users. 5~6 years ago, Google, Yahoo and Bing got together to make schema.org to try and wrangle a standard specification that everyone can use on their site. There ended up being 3 specifications you can use, microdata (markup elements directly in your html as needed) RDFa (you can think of this as microdata 2.0 in a lot of ways... it's much more flexible, but still implemented right in the html, along with the content you're marking up) and then there's JSON-LD.

    All 3 are basically languages that express similar concepts, they just do it with different syntax and different organizational structures. For example:

    Here’s a simple Microdata snippet:
    HTML Code:
    <p itemscope itemtype="http://schema.org/Person">
      <span itemprop="name">John Doe</span> is his name.
    </p>
    Here’s the same snippet using RDFa (Lite):
    HTML Code:
    <p typeof="schema:Person">
      <span property="schema:name">John Doe</span> is his name.
    </p>
    And here's the same thing expressed with JSON-LD:
    HTML Code:
    <script type="application/ld+json">
    {
      "@context": "http://schema.org/",
      "@type": "Person",
      "name": "John Doe"
    }
    Here's the catch, you my have noticed that the JSON-LD snippet doesn't actually contain the part of the document that mentions John Doe. All it's doing is saying there's a guy named John Doe. It's assumed that the document mentions John Doe somewhere, but it's up to the webmaster to make sure the content on the page actually matches the JSON-LD snippet. That's why Google says not to put anything in your JSON-LD code that's not actually contained in the page. As a relevant example, don't include schema for a location on a page that's not actually about that location.

    So, if there's 3 different specifications you can use, which should you pick? It doesn't actually matter hugely, though Google recommends JSON-LD, and JSON-LD is way easier to maintain. Since it's all in one block, you don't need to laboriously sift through a bunch of html just to find the relevant pieces to update or add. In other words... use JSON, and stop using microdata entirely.

  3. Members who thanked James Watt for this post:

    joedillon68 (02-28-2017)

  4. #3
    Member Since
    Sep 2012
    Location
    Nashville, TN
    Posts
    1,072
    Thanks
    129
    Thanked 152 Times

    Re: JSON Schema

    Quote Originally Posted by James Watt View Post
    So the way schema was originally implemented (as I understand it at least) was with a microdata style approach to adding meta data to content on your site. Makes sense, you have the html you want your users to see, and then you update it with meta data so that search engines can understand more information about what you're sharing with your users. 5~6 years ago, Google, Yahoo and Bing got together to make schema.org to try and wrangle a standard specification that everyone can use on their site. There ended up being 3 specifications you can use, microdata (markup elements directly in your html as needed) RDFa (you can think of this as microdata 2.0 in a lot of ways... it's much more flexible, but still implemented right in the html, along with the content you're marking up) and then there's JSON-LD.

    All 3 are basically languages that express similar concepts, they just do it with different syntax and different organizational structures. For example:

    Here’s a simple Microdata snippet:
    HTML Code:
    <p itemscope itemtype="http://schema.org/Person">
      <span itemprop="name">John Doe</span> is his name.
    </p>
    Here’s the same snippet using RDFa (Lite):
    HTML Code:
    <p typeof="schema:Person">
      <span property="schema:name">John Doe</span> is his name.
    </p>
    And here's the same thing expressed with JSON-LD:
    HTML Code:
    <script type="application/ld+json">
    {
      "@context": "http://schema.org/",
      "@type": "Person",
      "name": "John Doe"
    }
    Here's the catch, you my have noticed that the JSON-LD snippet doesn't actually contain the part of the document that mentions John Doe. All it's doing is saying there's a guy named John Doe. It's assumed that the document mentions John Doe somewhere, but it's up to the webmaster to make sure the content on the page actually matches the JSON-LD snippet. That's why Google says not to put anything in your JSON-LD code that's not actually contained in the page. As a relevant example, don't include schema for a location on a page that's not actually about that location.

    So, if there's 3 different specifications you can use, which should you pick? It doesn't actually matter hugely, though Google recommends JSON-LD, and JSON-LD is way easier to maintain. Since it's all in one block, you don't need to laboriously sift through a bunch of html just to find the relevant pieces to update or add. In other words... use JSON, and stop using microdata entirely.
    Thanks James.

    Do then I shouldn't markup the address at all since it's already mentioned in JSON? Google will find it in JSON and then search for it on our page which is effectively "marking it up"?
    Tutelary Marketing, Owner
    Local Listing Ninja - Business Listing Service

  5. #4
    James Watt's Avatar
    James Watt is offline Top Contributor
    Member Since
    Oct 2013
    Location
    Portland, OR
    Posts
    793
    Thanks
    138
    Thanked 285 Times

    Re: JSON Schema

    Yep, that's how it works. You can use microdata or JSON-LD, no need to use both for the same elements.
    Christopher W likes this.

  6. Members who thanked James Watt for this post:

    Christopher W (02-21-2017)

  7. #5
    Eric Rohrback's Avatar
    Eric Rohrback is offline Global Moderator
    Member Since
    Oct 2012
    Location
    Pittsburgh, PA
    Posts
    895
    Thanks
    131
    Thanked 238 Times

    Re: JSON Schema

    mark up everything you can. As an added tip for ease, use Google Tag manager to implement all the code. That way you can mark up new stuff as it comes up, and you don't have to mess with the code. Use Tag Manager's preview tool to test and make sure you implemented it correctly, then you're good to go.

    Don't use Microdata to mark up these days. Way too labor intensive.
    mborgelt likes this.
    My rarely updated website (I should fix that) - https://www.ericrohrback.com
    Follow me on Twitter
    Want to talk? Book time with me here

  8. #6
    Member Since
    Sep 2012
    Location
    Nashville, TN
    Posts
    1,072
    Thanks
    129
    Thanked 152 Times

    Re: JSON Schema

    So, just to confirm, I have JSON marketing up NAP in the back of the code. Then, I have our NAP in the footer, unmarked. Google will see our JSON marking up NAP in the back of the code and then search out our unmarked NAP in the footer and all is well, correct?
    Tutelary Marketing, Owner
    Local Listing Ninja - Business Listing Service

  9. #7
    Eric Rohrback's Avatar
    Eric Rohrback is offline Global Moderator
    Member Since
    Oct 2012
    Location
    Pittsburgh, PA
    Posts
    895
    Thanks
    131
    Thanked 238 Times

    Re: JSON Schema

    Google will see everything you put on the page. So they will see both the raw HTML in the footer and JSON markup.
    My rarely updated website (I should fix that) - https://www.ericrohrback.com
    Follow me on Twitter
    Want to talk? Book time with me here

  10. #8
    Member Since
    Sep 2012
    Location
    Nashville, TN
    Posts
    1,072
    Thanks
    129
    Thanked 152 Times

    Re: JSON Schema

    Quote Originally Posted by Eric Rohrback View Post
    Google will see everything you put on the page. So they will see both the raw HTML in the footer and JSON markup.
    I understand that. I'm just making sure the raw NAP html doesn't need to be marked up individually apart from the JSON. The fact that the JSON is marked up is sufficient enough and Google will be able to draw the link between the JSON and the raw NAP html, providing they match up correctly of course.
    Tutelary Marketing, Owner
    Local Listing Ninja - Business Listing Service

  11. #9
    Eric Rohrback's Avatar
    Eric Rohrback is offline Global Moderator
    Member Since
    Oct 2012
    Location
    Pittsburgh, PA
    Posts
    895
    Thanks
    131
    Thanked 238 Times

    Re: JSON Schema

    Yes, use JSON instead of microdata markup. Use raw HTML so the information renders for users, but JSON is what the search engines will digest.
    My rarely updated website (I should fix that) - https://www.ericrohrback.com
    Follow me on Twitter
    Want to talk? Book time with me here

  12. #10
    mborgelt's Avatar
    mborgelt is offline Top Contributor
    Member Since
    Jul 2012
    Location
    Denver, CO
    Posts
    470
    Thanks
    46
    Thanked 131 Times

    Re: JSON Schema

    Thanks for that tip, Eric. We are moving over to Tag Manager and I had no idea it did JSON as well.
    Free Local Checklist
    51Blocks - "White Label" Google Places & Website Development/Hosting - Will Pay Good $$ for Wordpress website hosting referrals
    Wordpress Site Speed Problems? Site speed optimization is part of our hosting - 90's on Google PageSpeed Insights

Page 1 of 3 123 LastLast

Similar Threads

  1. JSON-LD Schema Markup Generator
    By Robin in forum Local Search
    Replies: 9
    Last Post: 07-28-2016, 08:27 AM
  2. Replies: 0
    Last Post: 01-28-2016, 01:36 PM
  3. Replies: 0
    Last Post: 11-15-2015, 01:45 PM
  4. JSON-LD schema code for different location page on site
    By Ajay Prasad in forum Local Search
    Replies: 5
    Last Post: 09-15-2015, 07:14 AM
  5. The JSON-LD Markup Guide To Local Business Schema
    By Susan in forum Local Search
    Replies: 4
    Last Post: 06-01-2015, 02:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •