Creating an array of products in JSON-LD - seo

Can someone spot what's wrong with my code below? (It doesn't validate in the Google Structured Testing Tool.) I'm trying to create the JSON-LD code to add to a page that has multiple products for sale.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#graph": [
{
"#type": “Product”,
"name": “tshirt",
“description”: "test copy 1.”,
“image”: “image.jpg”
},
{
"#type": “Product”,
"name": “tshirt 2",
“description”: "test copy 2.”,
“image”: “image2.jpg”
}
]
}
</script>
Any help is much appreciated!

You are using “ instead of " in some places.
Replacing these, your snippet validates:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#graph": [
{
"#type": "Product",
"name": "tshirt",
"description": "test copy 1.",
"image": "image.jpg"
},
{
"#type": "Product",
"name": "tshirt 2",
"description": "test copy 2.",
"image": "image2.jpg"
}
]
}
</script>
Update: this snippet doesn't validate by using Google Rich Results Test anymore. Schema is being actively developed, so sometimes the requirements change after a while. For a list of products, Google is suggesting so called carousel.

Related

Editing Schema file in BigCommerce Cornerstone Theme

Google Merchant does not recognize my product size variations. The micro data that Cornerstone theme is generating is not display the different sku and price. I tried using Schema App but they can not edit theme files.
I am struggling with where to edit the schema.json files. I believe I know what to add but can not find how to edit the files.
This is the code I believe needed:
{
"#context": "http://schema.org/",
"#type": "Product",
"name": "Clarks Falalala Shoes for Men",
"image": "https://example.net/shoes/clarks-falalala.jpeg",
"description": "A great comfortable walking shoe, carried in sizes 9-11, but now size 11 isn’t in stock",
"offers": [ {
"#type": "Offer",
"sku": "QWERTYSHOE-9",
"price": 45.99,
"priceCurrency": "EUR",
"availability": "InStock"
},{
"#type": "Offer",
"sku": "QWERTYSHOE-10",
"price": 45.99,
"priceCurrency": "EUR",
"availability": "InStock"
},{
"#type": "Offer",
"sku": "QWERTYSHOE-11",
"price": 45.99,
"priceCurrency": "EUR",
"availability": "OutOfStock"
} ]
}
Please help me with where to edit schema file.
Thank you in advance for your help.

Combining Local business with Service & Area served schema

When I insert this code in the structured data testing tool I am only getting the first schema to show up. I can switch the order of the Local business and service w/ area served but when I do that only one of them shows up in the tool. The same thing happens when I try to split the two up and get them individually.
Working with json-ld scripts:
<script type="application/ld+json">
{
"#context": "https://schema.org",
"#type": "ProfessionalService",
"name": "Sebastian River Exterminating",
"image": "http://sebastianriverexterminating.com/images/extermination-logo-sebastian-fl.png",
"#id": "",
"url": "http://sebastianriverexterminating.com/",
"telephone": "7722289969",
"address": {
"#type": "PostalAddress",
"streetAddress": "124 Salazar Lane",
"addressLocality": "Sebastian",
"addressRegion": "FL",
"postalCode": "32958",
"addressCountry": "US"
},
"geo": {
"#type": "GeoCoordinates",
"latitude": 27.7600115,
"longitude": -80.50620599999999
},
"openingHoursSpecification": {
"#type": "OpeningHoursSpecification",
"dayOfWeek": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
],
"opens": "08:00",
"closes": "18:00"
},
"sameAs": "https://www.facebook.com/SebastianRiverExterminatingFL/timeline"
}
{
"#context": "http://schema.org",
"#type": "Service",
"serviceType": "Exterminator",
"additionalType": "https://en.wikipedia.org/wiki/Pest_control",
"areaServed": [
{
"#type": "City",
"name": "Sebastian",
"#id": "https://en.wikipedia.org/wiki/Sebastian,_Florida"
},
{
"#type": "City",
"name": "Roseland",
"#id": "https://en.wikipedia.org/wiki/Roseland,_Florida"
}
]}
</script>
That is not valid json or json-ld. You can only add one object to each script. e.g.
<script type="application/ld+json">
{
...
}
</script>
You can't list objects like you did.
One way around the issue is to add each into their own script tag.
Another is to use #graph to add them as an array inside an object. e.g.
<script type="application/ld+json">
{
"#graph": [
{
...
},
{
...
}
]
}
</script>
I believe you should use a sameAs not an #id in this case, since you are providing a reference for the search engine. also, I don't believe #id is a valid property of areaServed

I have a Shopify website and there are google search console error : "Unparsable structured data issue detected for site."

Unparsable structured data issue detected for Shopify website.
"#context": "http://schema.org",
"#type": "Product",
"#id": "https://example.com/products/full-clear-zirconia-silver-tennis-bracelet#product",
"brand": {
"#type": "Brand",
"name": "belledesoiree.com"
},
"sku": "78969",
"description": "
Timeless- Classy- Beautiful
If you buy this bracelet",
The fix for me was to locate the file responsible for outputting the page, in my case it was article.liiquid and escape the content only in the json portion.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Article",
"articleBody": "{{ article.content | strip_html | escape }}", //<<

Microsoft Refresh Cards Issue while making and HttpPOST Action

I am using Microsoft's message/action cards to send it to office outlook email and take necessary action when clicking on one of the buttons. This piece works fine.
But, now I want to use refresh cards feature to update that same email/card with say a message like RESTART PERFORMED
So I do the following
"potentialAction": [{
"#type": "ActionCard",
"name": "Restart",
"inputs": [{
"#type": "TextInput",
"id": "comment",
"isMultiline": False,
"title": "Add a comment here for restart"
}],
"actions": [{
"#type": "HttpPOST",
"name": "Restart Application",
"headers": [{"CARD-UPDATE-IN-BODY": True}],
"body": json.dumps(newcard_data),
"target": "https://73zed3u4sf.execute-api.us-east-1.amazonaws.com/test/restart"
} ]
}]
But I does not refresh my card.
I also tried "headers": [{"CARD-UPDATE-IN-BODY": "true"}] but doesn't work either.
Also here
newcard_data = {
"#type": "MessageCard",
"#context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "STATUS MESSAGE",
"sections": [{
"activityTitle": "NEW TASK",
"activitySubtitle": "On Project EB EVENTS",
"activityImage": "someimage",
"facts": [{
"name": "STATUS",
"value": "EC2 Rebooted"
}],
"markdown": True
}],
}
Any help will be appreciated.
Thanks.

jira REST API create issue including component

I am trying to create issue using Jira REST API incuding component. I am posting this JSON but I get The remote server returned an error: (400) Bad Request.
Issue is:-Without component there is no error, but when component is there issue created. Any help? JSON:
{
"fields": {
"project": {
"key": "keyGoesHere"
},
"assignee": {
"name": "name.surname"
},
"component": {
"name": "someName"
},
"summary": "test2",
"description": "test2",
"issuetype": {
"name": "Task"
}
}
}
I found the answer. Just in case someone needs it.
"components": [{
"name": "someName"
}],