SEO, AdWords, affiliates, advertising, and promotions
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.
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.
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:
Any help would be greatly appreciated.
Many thanks, Rosalind.
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
In main-product.liquid I changed:
"brand": {
"@type": "Thing",
"name": {{ product.vendor | json }}
},
To this
"brand": {
"@type": "Brand",
"name": {{ product.vendor | json }}
},
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>
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
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.
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.
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
In main-product.liquid I changed:
"brand": {
"@type": "Thing",
"name": {{ product.vendor | json }}
},
To this
"brand": {
"@type": "Brand",
"name": {{ product.vendor | json }}
},
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...
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.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024