How do I add "hasMerchantReturnPolicy" and "shippingDetails" to my structured data?

Solved

How do I add "hasMerchantReturnPolicy" and "shippingDetails" to my structured data?

limelight91
Excursionist
39 1 3

Hi! I noticed this is a new thing that Google has added to structured data. How can I add it to my site? 

Accepted Solution (1)

ilanadavis
Shopify Partner
242 32 80

This is an accepted solution.

Hey @limelight91 

 

Adding the return policy and shipping information into your structured data is really difficult mainly because it's not available in Shopify and the shipping information varies based on the customers location.

The best thing to do is to ensure you have the unique product identifiers in your structured data (e.g. GTIN - called barcode in Shopify, MPN and Brand) so that Merchant Center can validate the product feed with your structured data and what's visually on the page. Merchant Center will then use whatever your shipping and returns information is in Merchant Center to populate the shipping and returns information into Rich Results.

If you have these fields set up, you can ignore the warning in Search Console. Otherwise, you can install an app like JSON-LD for SEO that will include the unique product identifiers in the structured data so that your data connect with Merchant Center.

 

This article explains it a bit more in detail: https://www.ilanadavis.com/blogs/articles/search-console-includes-shipping-returns-for-merchant-list...

 

If you're not sure, I'd be happy to do a free structured data audit for your store. Feel free to email me at support@ilanadavis.com. 

Ilana Davis, Shopify Superhero
JSON-LD for SEO, adds structured data to your theme, getting you more organic traffic with Rich Results.

View solution in original post

Replies 11 (11)

ilanadavis
Shopify Partner
242 32 80

This is an accepted solution.

Hey @limelight91 

 

Adding the return policy and shipping information into your structured data is really difficult mainly because it's not available in Shopify and the shipping information varies based on the customers location.

The best thing to do is to ensure you have the unique product identifiers in your structured data (e.g. GTIN - called barcode in Shopify, MPN and Brand) so that Merchant Center can validate the product feed with your structured data and what's visually on the page. Merchant Center will then use whatever your shipping and returns information is in Merchant Center to populate the shipping and returns information into Rich Results.

If you have these fields set up, you can ignore the warning in Search Console. Otherwise, you can install an app like JSON-LD for SEO that will include the unique product identifiers in the structured data so that your data connect with Merchant Center.

 

This article explains it a bit more in detail: https://www.ilanadavis.com/blogs/articles/search-console-includes-shipping-returns-for-merchant-list...

 

If you're not sure, I'd be happy to do a free structured data audit for your store. Feel free to email me at support@ilanadavis.com. 

Ilana Davis, Shopify Superhero
JSON-LD for SEO, adds structured data to your theme, getting you more organic traffic with Rich Results.
limelight91
Excursionist
39 1 3

thank you very much for your thorough reply!

fedgery77
Excursionist
19 0 1

This was very helpful! Thank you for sharing!

RayRJr
Excursionist
14 0 8

I'm having a problem with this as well and I have eliminated most of the errors that google is throwing, it keeps telling me that I'm missing a comma or bracket with this though and I can't figure it out. I've looked over the code a dozen times and I just can't find the problem. I see no missing commas and all of the brackets seem to be doing their jobs. Can someone please scan over this code and tell me where the problem is?  I sell a digital product so once they have it they have it, returns aren't really a thing that can be done, hence the no returns. Any help would be really appreciated.

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Product",
  "name": {{ product.title | json }},
  "url": {{ shop.url | append: product.url | json }},
  {%- if product.featured_image -%}
    {%- assign image_size = product.featured_image.width | append: 'x' -%}
    "image": [
      {{ product.featured_image.src | img_url: image_size | prepend: "https:" | json }}
    ],
  {%- endif -%}
  "description": {{ product.description | strip_html | json }},
  {%- if current_variant.sku != blank -%}
    "sku": {{ current_variant.sku | json }},
  {%- endif -%}
  "brand": {
    "@type": "Thing",
    "name": {{ product.vendor | json }}
  },
  "offers": [
    {%- for variant in product.variants -%}
      {
        "@type" : "Offer",
        {%- if variant.sku != blank -%}
          "sku": {{ variant.sku | json }},
        {%- endif -%}
        "availability" : "http://schema.org/{% if variant.available %}InStock{% else %}OutOfStock{% endif %}",
        "price" : {{ variant.price | divided_by: 100.00 | json }},
        "priceCurrency" : {{ cart.currency.iso_code | json }},
        "url" : {{ shop.url | append: variant.url | json }},
      {% unless forloop.last %},{% endunless %}
    {%- endfor -%}
"hasMerchantReturnPolicy" : 
       { "@type" : "MerchantReturnPolicy",
        "applicableCountry" : "AU,DE,DK,HK,JP,NZ,SE,SG,UK,US",
        "merchantReturnLink" : "https://tattoodesigns.store/pages/terms-of-service",
        "returnPolicyCategory" : "https://schema.org/MerchantReturnNotPermitted"
}
  ]
}
</script>

 

RayRJr
Excursionist
14 0 8

So I made some changes and ran it through the schema code validator and it came up clean, I am now getting a totally different error. How can google say that something is wrong if the organization that makes the code says that it's right. I don't get it, I am now getting a "Missing '}' or object member name" error with this code:

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Product",
  "name": {{ product.title | json }},
  "url": {{ shop.url | append: product.url | json }},
  {%- if product.featured_image -%}
    {%- assign image_size = product.featured_image.width | append: 'x' -%}
    "image": [
      {{ product.featured_image.src | img_url: image_size | prepend: "https:" | json }}  ],
  {%- endif -%}
  "description": {{ product.description | strip_html | json }},
  {%- if current_variant.sku != blank -%}
    "sku": {{ current_variant.sku | json }},
  {%- endif -%}
  "brand": {
    "@type": "Thing",
    "name": {{ product.vendor | json }}
  },
  "offers": [
    {%- for variant in product.variants -%}
      { "@type" : "Offer",
        {%- if variant.sku != blank -%}
          "sku": {{ variant.sku | json }},
        {%- endif -%}
        "availability" : "http://schema.org/{% if variant.available %}InStock{% else %}OutOfStock{% endif %}",
        "price" : {{ variant.price | divided_by: 100.00 | json }},
        "priceCurrency" : {{ cart.currency.iso_code | json }},
        "url" : {{ shop.url | append: variant.url | json }},
      {% unless forloop.last %},{% endunless %}
    {%- endfor -%}
    ]
  "hasMerchantReturnPolicy": [
       { "@type" : "MerchantReturnPolicy",
        "applicableCountry" : "AU,DE,DK,HK,JP,NZ,SE,SG,UK,US",
        "merchantReturnLink" : "https://tattoodesigns.store/pages/terms-of-service",
        "returnPolicyCategory" : "https://schema.org/MerchantReturnNotPermitted" }
  ]
  }
</script>
RayRJr
Excursionist
14 0 8

figured it out, thanks anyway 🙂 I had unneeded brackets and was missing a comma, syntax is rough, hehehe

Scalblog
Shopify Partner
1 0 0

Hello, for people who would like to know how to fix the error about Missing } or object member name : add a coma , at the end of the ] before the line with hasMerchantReturnPolicy

SofiiaAst
Shopify Partner
50 1 2

Hey! This app allows to add Shipping methods schema: https://apps.shopify.com/seo-schema-for-products-1

Sofiia Astanina, Shopify app developer
Try SA SEO JSON‑LD Schema markup from Shopify app store
shredEngineer
Visitor
2 0 1

Hey Sofiia, thanks for the tip, trying this out right now.

 

EDIT: App looks solid, but there are some minor issues regarding special characters. I have just now sent you an email about this.

SofiiaAst
Shopify Partner
50 1 2

Hello! Thank you so much for your email! I am happy to cooperate with you and make the necessary improvements. I have just answered your email.

Sofiia Astanina, Shopify app developer
Try SA SEO JSON‑LD Schema markup from Shopify app store
shredEngineer
Visitor
2 0 1

The issue was resolved within hours. GREAT support! 🙂