I have some Schema.org JSON-LD like:
<script type='application/ld+json'>
{
"#context": "http://www.schema.org",
"#type": "WebSite",
"name": "Name",
"alternateName": "Alt Name",
"url": "http://Website.com"
}
</script>
And i have a website with pages where i list other peoples websites with a URL and a bit of info text.
Could i add the Schema.org JSON-LD data for all the external websites? like:
"name": "External Website 001",
Or does does it have to be used only once for my own website details on the main page etc?
If you want to say something about another website, it’s perfectly fine to use the WebSite type. Schema.org types are not required to be exclusively about your own things.
Let’s say you are reviewing the other website. Then you could use something like:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Review",
"url": "/reviews/acme-website",
"itemReviewed":
{
"#type": "WebSite",
"name": "ACME",
"url": "http://acme.example.com/"
}
}
</script>
If it’s not a review, but an article about the site, you could use Article (instead of Review) and its about property (instead of itemReviewed).
Related
We have successfully implemented Gmail Annotations for our emails. However, with Black Friday around the corner, we wanted to utilize multiple images with Catalog Cards. I found the reference guide that calls out the Item Properties and such, but I have no idea how to code this into JSON-LD. I use 250ok/Validity's script as a base, which is below. Can someone help me code or provide sample code for the Catalog Card annotation?
<script type="application/ld+json">
[{
"#context": "http://schema.org/",
"#type": "Organization",
"logo": "http://250ok.com/img/favicon-black.png"
},{
"#context": "http://schema.org/",
"#type": "EmailMessage",
"subjectLine": "Time to renew your 250ok Account"
},{
"#context": "http://schema.org/",
"#type": "DiscountOffer",
"description": "10% off",
"discountCode": "RENEW2019",
"availabilityStarts": "2020-11-06T08:00:00-07:00",
"availabilityEnds": "2020-11-25T08:00:00-07:00"
},{
"#context": "http://schema.org/",
"#type": "PromotionCard",
"image": "https://s3.amazonaws.com/250ok-wordpress/wp-content/uploads/2018/12/03212604/promo_sample.png"
}]
</script>
Example Image of the Catalog Card Carousel
I have seen the catalog cards working in the latest version of Gmail on Android when using a Gmail account that ends in promotabtesting#gmail.com. I have not seen this work on an iOS device yet nor on non-testing Gmail accounts (https://developers.google.com/gmail/promotab/best-practices#testing)
I have to inject multiple script elements for JSON-LD data into the head of my application, all pertaining to the same #type. This is due to pulling in different fields from different data source.
Will this duplication cause any problems?
<script type="application/ld+json">
{
"#type": "Organisation",
"name": "John Smith"
}
</script>
<script type="application/ld+json">
{
"#type": "Organisation",
"city": "London"
}
</script>
I'm hoping this will be translated by Google as simply:
<script type="application/ld+json">
{
"#type": "Organisation",
"name": "John Smith",
"city": "London"
}
</script>
Is that right?
Consumers can’t/shouldn’t assume that these JSON objects describe the same thing. (Think of a web page with information about many different organizations: it would of course be wrong to assume that they are the same organization.)
JSON-LD allows you to specify that the things described in different objects are identical: give them the same #id value.
#id takes an IRI which acts as identifier (it’s useful to provide them for many reasons).
See Node Identifiers in the JSON-LD spec.
So it could look like this (using Schema.org instead of your custom vocabulary):
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Organization",
"#id": "/organizations/42#this",
"name": "ACME"
}
</script>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Organization",
"#id": "/organizations/42#this",
"description": "…"
}
</script>
(The relative URL /organizations/42#this would represent the organization itself. It’s best practice then to provide this JSON-LD as well your information about the organization under /organizations/42.)
I have a medic weblog. My first page only has some data and top posts.
So I use this:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "WebPage",
"name": "website name",
"description": "website description",
"publisher": {
"#type": "WebPageMedic",
"name": "my company name"
}
}
</script>
Now for another page, how can I write JSON-LD format?
I try this:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "WebPage",
"name": "website name",
"description": "website description",
"publisher": {
"#type": "WebPageMedic",
"name": "my company name"
},
"mainEntity":{
"#type":"BlogPosting",
"headline":"BlogPosting",
"datePublished":"2015-03-09T13:08:00-07:00",
"articleBody": "articleBody"
}
}
</script>
I think I must write website information (WebPage) in all pages and then in mainEntity I can write BlogPosting and other things.
Am I right?
Yes, that is an appropriate structure if you want to have a WebPage item for every page (which is not necessary, but can be useful).
For a page that has multiple blog posts (in which case you might want to use CollectionPage), you could use a Blog item or an ItemList item as main entity. Another option is to use the hasPart property. See an example with mainEntity ItemList.
Notes about your example:
The properties of WebPage should be about the page, not about the site. You used "website name" and "website description". If you want to state something about your site, you can use the WebSite type.
There is no WebPageMedic type. You’ll probably want to use Organization or one of its sub-types, e.g., MedicalBusiness.
There is some way to reuse data in json-ld?
I have a WebSite and an Organization schemas with name, url and social links on it, i'm trying to get a better Google SEO and maybe one Google Graph Card like this:
https://developers.google.com/search/docs/guides/enhance-site
My json-ld is something like this:
<script type="application/ld+json">
[
{
"#context": "http://schema.org",
"#type": "WebSite",
"name": "Name",
"url": "http://www.example.com"
},
{
"#context": "http://schema.org",
"#type": "Organization",
"name": "Name",
"url": "http://www.example.com",
"sameAs": [
"https://twitter.com/example"
]
}
]
</script>
There is some way to not repeat name and url in both schemas?
And am I doing right? i really need the Organization schema to get these social links on the google card? Or the "sameAs" key could be in the WebSite schema?
I am following this guides:
https://developers.google.com/search/docs/data-types/sitename
https://developers.google.com/search/docs/data-types/social-profile-links
I'm trying to embed a snippet of code in my mandrill template in order to enable Google Schemas but whenever I try to publish the template Mandrill reloads and the code disappears.
The code is:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Order",
"merchant": {
"#type": "Organization",
"name": "mycompany.com"
},
"orderNumber": "*|ORDERNUMBER|*",
"priceCurrency": "*|CURRENCY|*",
"price": "*|ORDERTOTALAMOUNT|*",
"acceptedOffer": *|ITEMOFFEREDLIST|*
}
</script>
Any idea?
We currently support using Microdata to embed schemas in templates. We're still looking at ways we may be able to support the JSON-LD scripts for templates.