Multiple JSON-LD tag groups in one page - html

Can I use multiple JSON-LD groups (using Schema.org) in the same page?
If I can't, how to combine them together? I'm not so familiar with the syntax.
Group 1:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "LocalBusiness",
"address": {
"#type": "PostalAddress",
"streetAddress": "3102 Highway 98",
"addressRegion": "FL",
"addressLocality": "Mexico Beach",
"postalCode": "45252",
"addressCountry": "US",
},
"geo": {
"#type": "GeoCoordinates",
"latitude": "40.75",
"longitude": "73.98"
},
"name": "Beachwalk Beachwear & Giftware",
"telephone": "850-648-4200",
"email": "admin#example.com",
"faxNumber": "860-562-4250",
}
</script>
Group 2:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Organization",
"url": "http://example.com",
"name": "My Domain Title",
"logo": "http://example.com/wp-content/uploads/2015/08/abc.jpg",
"contactPoint": [
{
"#type": "ContactPoint",
"telephone": "0192-39192130",
"contactType": "customer service"
},
{
"#type": "ContactPoint",
"telephone": "0182-239120398",
"contactType": "customer service"
}
],
"sameAs": [
"http://facebook.com/myfbaccount",
"http://twitter.com/mytwitteraccount"
]
}
</script>

You can either have multiple script blocks on your page or combine it in a single block. The easiest way to combine them into a single block is to use the #graph keyword as follows:
<script type="application/ld+json">
{
"#graph": [
{ ... your first JSON-LD block ... },
{ ... your second JSON-LD block ... }
]
}
</script>

According to the spec (https://www.w3.org/TR/json-ld/#h3_advanced-context-usage) the usage of several contexts is possible with a simple list of contexts:
[
{
"#context": "http://example.org/contexts/person.jsonld",
"name": "Manu Sporny",
"homepage": "http://manu.sporny.org/",
"depiction": "http://twitter.com/account/profile_image/manusporny"
},
{
"#context": "http://example.org/contexts/place.jsonld",
"name": "The Empire State Building",
"description": "The Empire State Building is a 102-story landmark in New York City.",
"geo": {
"latitude": "40.75",
"longitude": "73.98"
}
}
]

Related

How can i get the current URL (its dynamic, because of a blog) to a Schema.org File?

I want to create a Schema.org for our blog. Unfortunately I don't have a placeholder for the corresponding URL. Can someone help me?
<script type="application/ld+json">
{
"#context": "https://schema.org/",
"#type": "BreadcrumbList",
"itemListElement": [{
"#type": "ListItem",
"position": 1,
"name": "netpulse.ch",
"item": "https://www.netpulse.ch"
},{
"#type": "ListItem",
"position": 2,
"name": "Online Marketing News",
"item": "https://www.netpulse.ch/blog/"
},{
"#type": "ListItem",
"position": 3,
"name": "{{blog.title}}",
"item": "{{InitialPostAlias}}"
}]
}
</script>

Structured data not working right with CSS selectors (adding slashes in links and other problems). How do I fix this?

I work for a website with 10000+ products and I decided to input the structured data dynamically via CSS selectors in GTM because doing it manually would be too time consuming. It all worked fine, but then I ran into some problems.
Firstly, the structured data added slashes to links that lead to a 404, like so:
"url": "https:\/\/example.com\/shop\/category\/subcategory\/product"
Secondly, the prices in my country are separated with a comma, and not a dot, so the rich results test returns an error. Is there a way to change this?
Full schema here.
<script type="application/ld+json"> {
"#context": "https://www.schema.org",
"#type": "product",
"sku": "{{sku}}",
"image": ["{{carousel-item active}}"],
"name": "{{product-title}}",
"description": "{{product-description}}",
"category": "{{category}}",
"brand": {
"#type": "brand",
"name": "BRAND",
"logo": "https://example.com/images/logo.png"
},
"offers": {
"#type": "Offer",
"itemCondition": "http://schema.org/NewCondition",
"availability": "http://schema.org/InStock",
"price": "{{price}}",
"priceValidUntil": "2021-11-11",
"priceCurrency": "HRK",
"url": "{{Page URL}}",
"shippingDetails": {
"#type": "OfferShippingDetails",
"shippingRate": {
"#type": "MonetaryAmount",
"value": "25",
"currency": "HRK"
},
"shippingDestination": {
"#type": "DefinedRegion",
"addressCountry": "HR"
},
"deliveryTime": {
"#type": "ShippingDeliveryTime",
"transitTime": {
"#type": "QuantitativeValue",
"minValue": "3",
"maxValue": "5"
},
"cutOffTime": "17:00-08:00",
"businessDays": {
"#type": "OpeningHoursSpecification",
"dayOfWeek": [
"https://schema.org/Monday",
"https://schema.org/Tuesday",
"https://schema.org/Wednesday",
"https://schema.org/Thursday",
"https://schema.org/Friday" ]
}
}
}
}
}
}
</script>
I am very new to this, so please be gentle.
P.S. All other parts of schema work fine.

How can I fix the JSON code error in the attached picture from the code below?

JSON-LD markup generated by Google Structured Data Markup Helper.
error description in image.
here
here is my json
<script type= "application/ld+json">
{
"#context" : "http://schema.org",
"#type" : "Article",
"headline" : "7 Ways To .........",
"author" : {
"#type" : "Person",
"name" : "xxxxxxxxx",
},
"datePublished" : "2017-06-22T08:50",
"image" : {
"#type": "imageObject",
"url":"xxxxx",
},
"articleSection" : "Use one of three methods to find the value of the business–cash flow, market or assets. Then boost business value quickly.",
"url" : "xxxxx",
"publisher" : {
"#type" : "Organization",
"name" : "xxxxxxxxxx",
"logo": {
"#type": "imageObject",
"url": "xxxxxx",
}
},
}</script>
several time extra comma in end of the value.
valid JSON below
{
"#context": "http://schema.org",
"#type": "Article",
"headline": "7 Ways To .........",
"author": {
"#type": "Person",
"name": "xxxxxxxxx"
},
"datePublished": "2017-06-22T08:50",
"image": {
"#type": "imageObject",
"url": "xxxxx"
},
"articleSection": "Use one of three methods to find the value of the business–cash flow, market or assets. Then boost business value quickly.",
"url": "xxxxx",
"publisher": {
"#type": "Organization",
"name": "xxxxxxxxxx",
"logo": {
"#type": "imageObject",
"url": "xxxxxx"
}
}
}

How can I improve this JSON-LD Schema for local service area business?

I am new to any kind of coding and put this together myself. I have a service area business... no brick and mortar store.. and we cover about a 30 mile radius of Sacramento, CA. This is the JSON-LD I have made for my home page.
I think I am supposed to make JSON-LD schema for other pages as well, but not sure what to put on it that is different than this?
I also feel like I am missing stuff that would really help me out in search results, but I am not sure what. I am open to all feedback!
website: www.yogabearpc.com
Here is my current home page code:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "ProfessionalService",
"address": {
"#type": "PostalAddress",
"addressLocality": "Sacramento",
"addressRegion": "CA",
"postalCode":"95816",
"streetAddress": ""
},
"description": "Yoga Bear Computer Repair is a mobile and onsite computer repair company in Sacramento, CA. Rated #1, we repair laptops, desktops, PCs, and Apple Macs.",
"name": "Yoga Bear Computer Repair",
"telephone": "916-800-3035",
"openingHours": "Mo-Su 00:00-24:00",
"geo": {
"#type": "GeoCoordinates",
"latitude": "38.56",
"longitude": "-121.47"
},
"logo": "http://www.yogabearpc.com/wp-content/uploads/2016/05/logo.jpg",
"email":"mailto:yogabearpc#gmail.com",
"url":"http://www.yogabearpc.com/",
"sameAs" : [ "https://www.facebook.com/yogabearpc",
"http://www.twitter.com/YogaBearPC",
"https://plus.google.com/+YogaBearPCRepairSacramento",
"https://www.instagram.com/yogabearpc/",
"https://www.linkedin.com/in/yoga-bear-computer-repair-178a32111",
"https://www.pinterest.com/yogabearpc/",
"https://www.youtube.com/channel/UCHmmLsYH9252HxlOjXD9t9w",
"https://www.yelp.com/biz/yoga-bear-computer-repair-sacramento-2"]
}
EDITED
Consider this:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "ProfessionalService",
"name": "Yoga Bear Computer Repair",
"description": "Yoga Bear Computer Repair is a mobile and onsite computer repair company in Sacramento, CA. Rated #1, we repair laptops, desktops, PCs, and Apple Macs.",
"areaServed": [{
"#type": "Place",
"geo": {
"#type": "GeoCircle",
"geoMidpoint": {
"#type": "GeoCoordinates",
"latitude": "38.56",
"longitude": "-121.47"
},
"geoRadius": "50"
}
},
{
"#type": "Place",
"hasMap": "place URL to map here; e.g. the Google map URL"
},
{
"#type": "Place",
"address": {
"#type": "PostalAddress",
"addressLocality": "Sacramento",
"addressRegion": "CA",
"postalCode": "95816"
}
}],
"address": {
"#type": "PostalAddress",
"addressLocality": "Sacramento",
"addressRegion": "CA",
"postalCode": "95816",
"streetAddress": ""
},
"contactPoint": {
"#type": "ContactPoint",
"url": "http://www.yogabearpc.com/",
"contactType": "customer service",
"telephone": "+1.916.800.3035",
"email": "yogabearpc#gmail.com",
"hoursAvailable": {
"#type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"],
"opens": "08:00",
"closes": "18:00"
}
},
"logo": {
"#type": "ImageObject",
"url": "http://www.yogabearpc.com/wp-content/uploads/2016/05/logo.jpg",
"width": {
"#type": "QuantitativeValue",
"value": "xx"
},
"height": {
"#type": "QuantitativeValue",
"value": "xx"
}
},
"url": "http://www.yogabearpc.com/",
"sameAs": ["https://www.facebook.com/yogabearpc",
"http://www.twitter.com/YogaBearPC",
"https://plus.google.com/+YogaBearPCRepairSacramento",
"https://www.instagram.com/yogabearpc/",
"https://www.linkedin.com/in/yoga-bear-computer-repair-178a32111",
"https://www.pinterest.com/yogabearpc/",
"https://www.youtube.com/channel/UCHmmLsYH9252HxlOjXD9t9w",
"https://www.yelp.com/biz/yoga-bear-computer-repair-sacramento-2"]
}
</script>
You'll want to update specific values, such as the logo dimensions. These dimensions are Google-manadatory.
You also may wish to add time zone information on service hours (I didn't look-up that value for the areaServed).

Email Markup Tester

Google's email Markup Tester always fails with the error
"INVALID_OBJECT: orderStatus,http://schema.org/OrderStatusType"
I have tried with all there samples located on this page:
https://developers.google.com/gmail/markup/reference/order
Do we think its just a question of waiting for them to fix it?
example json:
<html>
<body>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Order",
"merchant": {
"#type": "Organization",
"name": "Amazon.com"
},
"orderNumber": "123-4567890-1234567",
"priceCurrency": "USD",
"price": "29.99",
"acceptedOffer": {
"#type": "Offer",
"itemOffered": {
"#type": "Product",
"name": "Google Chromecast"
},
"price": "29.99",
"priceCurrency": "USD",
"eligibleQuantity": {
"#type": "QuantitativeValue",
"value": "1"
}
},
"url": "https://www.amazon.ca/gp/css/summary/edit.html/orderID=123-4567890-1234567"
}
</script>
</body>
</html>
I had the same issue and fixed validation by adding:
"orderStatus" : "OrderDelivered",
I noticed using the following didn't work (even though it is how the Google Example in the documentation has it ):
"orderStatus": "http://schema.org/OrderStatus/OrderDelivered",
The problem is that Google is insisting that you provide a valid statusOrder key. The the following validates:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Order",
"merchant": {
"#type": "Organization",
"name": "Amazon.com"
},
"orderNumber": "123-4567890-1234567",
"priceCurrency": "USD",
"price": "29.99",
"acceptedOffer": {
"#type": "Offer",
"itemOffered": {
"#type": "Product",
"name": "Google Chromecast"
},
"price": "29.99",
"priceCurrency": "USD",
"eligibleQuantity": {
"#type": "QuantitativeValue",
"value": "1"
}
},
"orderStatus" : "OrderDelivered",
"url": "https://www.amazon.ca/gp/css/summary/edit.html/orderID=123-4567890-1234567"
}
</script>