Google structured data for Events - seo

I want to show events on Google, so I have created this JSON-LD:
<script type="application/ld+json">
[{
"#context": "http://schema.org",
"#type": "TestEvent",
"name": "Rohit Patil Event",
"startDate": "2014-10-10T19:30",
"location": {
"#type": "Place",
"name": "Warner Theatre",
"address": "Washington, DC"
},
"offers": {
"#type": "Offer",
"url": "https://www.etix.com/ticket/1771656"
}
}
]
</script>
I have tested this in testing tool and having 0 error.
How can I use this code to work on Google? What is the best file to place this code?

You add the script element to the page about this event, either in the head or in the body.
It becomes clearer if you use Microdata or RDFa instead of JSON-LD, because there you have to mark up your existing content. With JSON-LD you duplicate the content, but it still should be placed where the actual/visible content is.

You need to embed this into a webpage whose content is about the same event. You can find more information at:
https://developers.google.com/search/docs/guides/intro-structured-data#markup-formats-and-placement
JSON-LD is the recommended format by Google at this point btw.

In this case "the best file" to put that code is in the Rohit Patil Event file. It should go somewhere between the head section of that webpage. I.e.
<html>
<head>
..your json-ld code..
</head>
</html>

Related

Should the schema.org type Webpage show up as rich result?

I'm having trouble getting my paywalled content indexed by Google. I want try and see if adding schema to the pages to mark them as paywalled content will fix this problem.
Therefor I add this piece of code to my pages;
<script type="application/ld+json">
{
"#context": "https://schema.org",
"#type": "WebPage",
"name": "Page title",
"description": "Page description.",
"publisher": {
"#type": "EducationalOrganization",
"name": "Name Educational Organization"
},
"isAccessibleForFree": "False"
}
</script>
I tested this via: https://search.google.com/test/rich-results but the result is "No items detected". Is this how it should be because I used the WebPage type? Or is there something I should do to get this to work?

JSON-LD for multiple pages (Course Intro page & Lesson pages) that make up a course

I'm unsure how to mark-up my pages that make up a course. Let's say I have the following pages, where the first in each group is a Course Introduction page, and each of the following is a single Lesson Page within the course. All the pages together technically make up the entire course. The course is completely online, and you go at your own pace.
www.myeducationalsite.com/course-1
www.myeducationalsite.com/course-1/lesson-1
www.myeducationalsite.com/course-1/lesson-2
www.myeducationalsite.com/course-1/lesson-3
www.myeducationalsite.com/course-2
www.myeducationalsite.com/course-2/lesson-1
www.myeducationalsite.com/course-2/lesson-2
I am using the Course object from schema.org to describe the Course Introduction page, but I was unsure which object type to use for the Lesson pages.
I'm also unsure how to describe their relationships. The hasCourseInstance property didn't seem to be what I need, but maybe I'm misunderstanding. I understand I can use hasPart and isPartOf to describe relationships, but I was unsure what #type to even use on the Lesson pages.
How can I use JSON-LD to describe the relationship of the pages that make up the Course?
Browsing the schema.org site tells that the hasPart relationship points to a CreativeWork, the most relevant sub-class of which for your use-case might perhaps be LearningResource:
The LearningResource type can be used to indicate CreativeWorks
(whether physical or digital) that have a particular and explicit
orientation towards learning, education, skill acquisition, and other
educational purposes.
So perhaps something along these lines?
[
{
"#context": "https://schema.org/",
"#id": "https://www.myeducationalsite.com/course-1",
"#type": "Course",
"hasPart": [
{
"#type": "LearningResource",
"#id": "https://www.myeducationalsite.com/course-1/lesson-1"
},
{
"#type": "LearningResource",
"#id": "https://www.myeducationalsite.com/course-1/lesson-2"
},
{
"#type": "LearningResource",
"#id": "https://www.myeducationalsite.com/course-1/lesson-3"
}
]
},
{
"#context": "https://schema.org/",
"#id": "https://www.myeducationalsite.com/course-2",
"#type": "Course",
"hasPart": [
{
"#type": "LearningResource",
"#id": "https://www.myeducationalsite.com/course-2/lesson-1"
},
{
"#type": "LearningResource",
"#id": "https://www.myeducationalsite.com/course-2/lesson-2"
}
]
}
]
Here is a link to JSON-LD Playground for the above.

JSON-LD: What is the correct syntax for the Report schema type?

I've used several JSON-LD formatting tools (Example 1, Example 2, Example 3), but none are so specific as to list the schema type Report, and its property reportNumber. The schema type is documented here, but without examples.
This page has been a helpful reference, but I still have uncertainty.
So I would like to know if the following syntax is correct, and what to change if it's not:
<script type="application/ld+json">
{
"#context": "https://schema.org",
"#type": "Report",
"reportNumber": "1234",
"headline": "Report Headline",
"description": "Report Description",
"image": "img.jpg",
"author": {
"#type": "Organization",
"name": "Org. Name",
"url": "example.com"
},
"publisher": {
"#type": "Organization",
"name": "Org. Name",
"logo": {
"#type": "ImageObject",
"url": "logo.svg"
}
},
"datePublished": "2021-11-24",
"dateModified": "2021-11-24"
}
</script>
I just swapped the type Article for Report. It appears to me that Report is a subset of the Article type, making properties like headline and description still valid, but in addition, making the property reportNumber valid. I'm new to JSON-LD.
It looks like you are doing it correctly. In JSON-LD you can use any of the properties of a class in any of its subclasses.
In order to validate your JSON-LD, I have used the Google's structured tool JSON-LD validator, available at https://validator.schema.org/. I think you may find it useful in the future.
Your snippet passed the tests with zero errors or warnings. Just be careful with "logo.svg", because it is a relative path.I would add the full URL to your logo. The same applies for img.jpg

Star Rating Rich Snippets Not Showing on Google

I have tried several ways to try to get Rich Snippets Markup showing for my Reviews. I am currently just testing it on one page in order to find out what to do to get it to show on Google.
I have re-indexed my site and no luck.
Google says for the test that it is working correctly, but I cannot get it to show up.
Does anyone have any ideas what I might be doing wrong? I am lost.
https://bitcoincasinolord.com/casino-reviews/bitstarz/
​
<script type="application/ld+json">
{
"#context": "http://schema.org/",
"#type": "Review",
"url": "https://bitcoincasinolord.com/casino-reviews/bitstarz-casino-review/",
"itemReviewed": {
"#type": "Organization",
"name": "Bitstarz Casino"
},
"reviewRating": {
"#type": "Rating",
"ratingValue": "8.9",
"bestRating": "10",
"worstRating": "0"
},
"author": {
"#type": "Organization",
"name": "BitcoinCasinoLord"
}
}
</script>
it is not must to show the everything as rich results. if you page passes rich result test that's good but google decides what to show as rich result. it depends upon many factors.
Reasons Why Your Rich Snippets Aren’t Showing

Structured Data Testing Tools following #id references for JSON-LD – Will this work as expected?

I'm working on marking up a site with schema data using JSON-LD. After doing my homework, I learned that #id could be used to reference other snippets of schema. Such as writing WebPage schema that isPartOf my WebSite schema.
Following this, I created the basic schemas for my website; Organization, WebSite, and WebPage where WebSite links to WebPage and Organization.
When I plug my markup into Google's Structured Data Testing tool, it all gets rolled up into the WebSite schema. However, when I remove the #id references, then it is shown as three different types of schema.
With #id
Without #id
Of course, I want my schema data to be interpreted as a series of relationships, that's the whole point. But I also want to make sure each individual schema is being parsed.
So what do you think, will this be okay?
Organization
{
"#context": "http://schema.org",
"#type": "Organization",
"#id": "https://example.com/#organization",
"name": "Organization",
"legalName": "Organization, Inc",
"description": "We rock",
"logo": "https://www.example.com/images/logo.jpg",
"url": "https://www.example.com",
"telephone": "+1-111-111-1111",
"sameAs": ["https://twitter.com/example", "https://www.linkedin.com/company/example/", "https://plus.google.com/u/0/+example", "https://www.facebook.com/example", "https://www.youtube.com/user/example", "https://www.instagram.com/example/", "https://en.wikipedia.org/wiki/example", "https://www.wikidata.org/wiki/Q1", "https://www.crunchbase.com/organization/example"],
"address":
{
"#type": "PostalAddress",
"streetAddress": "111 Street",
"addressLocality": "Nowhere",
"postalCode": "11111",
"addressCountry": "United States"
}
}
WebSite
{
"#context": "http://schema.org",
"#type": "WebSite",
"#id": "https://example.com/#website",
"name": "Website",
"alternateName": "Web",
"url": "https://www.example.com",
"hasPart":
{
"#type": "WebPage",
"#id": "https://www.example.com/#webpage"
}
}
WebPage
{
"#context": "http://schema.org",
"#type": "WebPage",
"#id": "https://www.example.com/#webpage",
"name": "Webpage",
"description": "Told you, we rock",
"url": "https://www.example.com/",
"isPartOf":
{
"#id": "https://www.example.com/#website"
},
"potentialAction":
{
"#type": "SubscribeAction",
"agent":
{
"#type": "Organization",
"#id": "https://example.com/#organization"
},
"object":
{
"#type": "Product",
"name": "Mailing List"
}
}
}
Of course, I want my schema data to be interpreted as a series of relationships, that's the whole point.
Exactly. Making use of #id references is one way to achieve this, nesting the full items is the other way. The result will be the same, i.e., they are equivalent.
But I also want to make sure each individual schema is being parsed.
If you know a consumer that only recognizes top-level items, you might want to adapt. It’s often possible to have one item of your choice on the top-level (by making use #reverse or inverse properties, if existing), but tools like Google’s SDTT might of course display the parsed result in a different way.
But unless you know such a consumer, I don’t think it would be advisable to omit using properties with item values. You would miss out on the most important semantic signal: relations.
In theory, providing the mainEntity/mainEntityOfPage property should be sufficient for page-oriented consumers to learn what the primary entity on that page is. In practice, consumers might not recognize/support this property, of course. But I don’t see how it should be easier for consumers to handle several top-level items, where it’s unclear in which relation they stand to each other (because the relations aren’t specified), so consumers should have an interest to support the common way how Schema.org structured data is provided on the Web.