Google Rich Results - Duplicate products and lots of warnings!

OliviaMichaelCo
Pathfinder
120 9 23

Hey you wonderful people! I hope everyone had a great Christmas.

 

It's time to get back to working on my store, and today I have another problem that, despite spending a few hours trying to find an answer, I'm a little perplexed at what might be wrong.

 

I ran one of my products through the Google Rich Text Test tool: https://search.google.com/test/rich-results

 

I was surprised to see that the first product I tested showed as a duplicate, and each one had warnings. 

 

Screenshot 2021-12-29 at 10.59.51.jpg

Issue number 1: Why are there duplicate products here? Each product page only has one product. Is it because I use a 'you might also like' section below? Or is there something else causing this? Perhaps an app or something? For reference, this specific product is here: https://oliviamichaelcandle.co/products/old-fashioned-vegan-friendly-luxury-scented-candle

 

Issue number 2: How do I correct these errors? From looking at them, my products have this information, but Google just cannot get it from my product code. For example, aggregateRating is missing, but I can see there is a rating and it's in the code.

 

Screenshot 2021-12-29 at 11.02.21.jpg

There are a few errors like this in both the products. Ideally, I would like to only have one product and have that product set up correctly to not show these errors. From what I can see, I have all the information that I'm supposedly missing, except for the global identifier.

 

All errors:

 

  • Missing field 'brand'
  • Missing field 'image'
  • Missing field 'review'
  • Missing field 'aggregateRating'
  • No global identifier provided
  • Missing field 'priceValidUntil'

 

Any help would be greatly appreciated.

 

Many thanks, Rosalind.

Replies 7 (7)

OliviaMichaelCo
Pathfinder
120 9 23

Okay so it actually looks like the duplication is caused by "@type": "AggregateRating" being separate to the product. I don't know how to fix this so that doesn't happen.

 

List of items I've fixed and their solution

 

  • FIXED: Missing field 'brand'

In main-product.liquid I changed:

 

"brand": {
"@type": "Thing",
"name": {{ product.vendor | json }}
},

 

To this

 

"brand": {
"@type": "Brand",
"name": {{ product.vendor | json }}
},

OliviaMichaelCo
Pathfinder
120 9 23

This, from what I can tell, is where all the information above should be, but it isn't for some reason. Why is Shopify and the default Shopify template not providing this stuff out of the box? 

 

<script type="application/ld+json">
  {
    "@context": "http://schema.org/",
    "@type": "Product",
    "name": {{ product.title | json }},
    "url": {{ shop.url | append: product.url | json }},
    {%- if product.selected_or_first_available_variant.featured_media -%}
      {%- assign media_size = product.selected_or_first_available_variant.featured_media.preview_image.width | append: 'x' -%}
      "image": [
        {{ product.selected_or_first_available_variant.featured_media | img_url: media_size | prepend: "https:" | json }}
      ],
    {%- endif -%}
    "description": {{ product.description | strip_html | json }},
    {%- if product.selected_or_first_available_variant.sku != blank -%}
      "sku": {{ product.selected_or_first_available_variant.sku | json }},
    {%- endif -%}
    "brand": {
      "@type": "Brand",
      "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 -%}
    ]
  }
</script>

ilanadavis
Shopify Expert
188 25 60

Hey Rosalind,

Having more than one set of product data is normal and a common misconception that there should be only one.

The first set of Product data is from your theme and the second is from the Shopify Product Reviews app. Both are missing a lot of data which is why it has so many warnings.

The warnings are because Google recommends these in order to qualify for Rich Results.

You can code this information yourself or use an app. Coding yourself (or hiring a developer to do it for you) isn't hard, but you would then have to maintain the code going forward and Google updates what's required or recommended for Rich Results.

I'd recommend an app like JSON-LD for SEO or something similar. Apps won't remove the warnings but the app will provide all the data Google needs for you to qualify for Rich Results.

Google Search will pick the best set of data to use for its analysis. That'll be the set from JSON-LD for SEO. They'll ignore the other Product data.

I cover these in more detail in my article on testing the structured data.
https://www.ilanadavis.com/articles/test-json-ld-code-shopify/

Hopefully, that helps but let me know if you have other questions.
Ilana

Ilana Davis, Shopify Superhero
JSON-LD for SEO, adds structured data to your theme, getting you more organic traffic with Rich Results.
Linking Llama, link complementary, comparable, or related products to improve SEO & UX.
OliviaMichaelCo
Pathfinder
120 9 23

Thank you @ilanadavis I think we both replied at the same time.

 

I will take a read through what you have posted. It seems that I need to provide that information in the code snippet I posted. Why Shopify doesn't do this on their default code is beyond me, unless it is so that we buy development time to fix it.

 

I'll try to research some more to see how I add the missing info that they're requesting.

 

Thanks.

ilanadavis
Shopify Expert
188 25 60

I completely agree (and it's my app that provides the correct data), Shopify should require this for all themes but they only require that the product structured data exists, not that it is complete. You'd still need to connect your reviews with the product data which my app does with our integrations.

Read through it and feel free to email me if you have questions about the app at support@ilanadavis.com.

The snippet you shared is in the right place. You can absolutely add the code yourself, just maintaining it can be not fun, and anytime you edit the theme code and update your theme, your edits disappear. That's why an app is often the route to go. My app is the same cost as hiring a developer to do it for you once, but you get updates for free.

Ilana Davis, Shopify Superhero
JSON-LD for SEO, adds structured data to your theme, getting you more organic traffic with Rich Results.
Linking Llama, link complementary, comparable, or related products to improve SEO & UX.
OliviaMichaelCo
Pathfinder
120 9 23

Thanks, @ilanadavis -- for someone new it's a bit of a minefield but I'll get there in the end, I'm sure.

 

Since I cannot edit my second post and update. I now have the image working.

 

List of items I've fixed and their solution

 

  • FIXED: Missing field 'brand'

In main-product.liquid I changed:

 

"brand": {
"@type": "Thing",
"name": {{ product.vendor | json }}
},

 

To this

 

"brand": {
"@type": "Brand",
"name": {{ product.vendor | json }}
},

 

  • FIXED: Missing field 'image'

In main-product.liquid I changed:

 

    {%- if product.selected_or_first_available_variant.featured_media -%}

      {%- assign media_size = product.selected_or_first_available_variant.featured_media.preview_image.width | append: 'x' -%}

      "image": [

        {{ product.selected_or_first_available_variant.featured_media | img_url: media_size | prepend: "https:" | json }}

      ],

    {%- endif -%}

 

To this

 

{% if seo_media -%}
{%- assign media_size = seo_media.preview_image.width | append: 'x' -%}
"image": [
{{ seo_media | img_url: media_size | prepend: "https:" | json }}
],
{%- endif %}

 

And just above '<script type="application/ld+json"> I added the following

 

{%- liquid
if product.selected_or_first_available_variant.featured_media
assign seo_media = product.selected_or_first_available_variant.featured_media
else
assign seo_media = product.featured_media
endif
-%}

 

++++++++++++++++++

 

Note, I'm not 100% sure what I'm doing here. I'm kinda new to this but have a good idea, so please, only copy my solution at your own risk.

 

Two down...

FlowersGC
Excursionist
31 1 8

Hi Rosalind - did you ever find the solution to this? I have managed to solve all of my data, but any review app seems to cause duplication.