Liquid, JavaScript, themes, sales channels
Hi everyone,
I'm trying to improve my SEO and SemRush has picked up on a few issues that I have no clue how to fix. I've tried Google Search Central but being such a noob, it's all confusing me.
I have 25 product pages with this error message:
'Either 'offers', 'review' or 'aggregateRating' should be specified'
Here's an example of some affected pages:
https://soapcult.com.au/collections/best-sellers/products/devotion-body-soap
https://soapcult.com.au/products/full-moon-body-soap
Can anyone tell me what's gone wrong with these pages and how I can fix?
Thank you so much, Aliya.
Basically follow what the warnings say, there is Metadata or JSON-LD improvements to make.
There might be some shortcuts like an app like "JSON-LD for SEO" but if there is existing schema you may need to investigate where this is coming from first. Most likely culprits are an app or a theme.
Usually the quickest way to fix most of it to nuke any schema in the theme (can be a bit technical) and then get that app I mentioned.
Thanks KieranR,
Unfortunately that's all outside of my skillset, I'll most likely destroy my theme deleting things I don't understand.
From your experience, will these issues be really affecting my SEO or is it just best practice?
A robust schema setup is important for ecom SEO, mostly because the extra pretty search results it enables. Things like review stars & prices seem to make a big difference. There are a number of case studies out there that indicate a lift in product page organic search performance after turning on a good schema setup.
So yeah worth doing, not just a best practice thing.
Ok great, thank you for your help 😄
I have an issue with the structured data/ schema markup on my site. I added all of the fields and checked it with Google rich snippets checker and it said it was good. However, when I add it on the product pages, they have errors. In the "name" field for some reason, it shows as "default title" if there are no variables. The products that have variables show the size in the spot for the name. These are not the names I specified so I am not sure how they are being changed. I also don't know where to access this information. I have been adding the schema data to the end of the product description opposed to editing the code. Any help is greatly appreciated!
@migreen06 The short answer is that to make it work properly, you'll probably need to setup a conditional rule for outputting the JSON-LD "name" field depending on if the variant.name is "Default Title" or not.
Long answer:
It sounds like you are only using the {{ variant.title }} in the output for the JSON-LD "name" key.
I say this because Shopify products with no variants, technically have an virtual variant on the back, and the {{ variant.name }} for that variant is auto-set to "Default Title".
For example, lets say you have these three products, two of which have variants:
{{ product.title }} | {{ variant.title }} |
LED Bike Lamp | n/a |
Boys 26in Bicycle | Red Green Blue |
Unisex Mountain Bike | Front suspension |
^ in the above example, technically the "LED Bike Lamp" product has no variants. However on the back of Shopify and accessible within Liquid there is 1x invisibile variant called "Default Title".
If you're going down the route of manually implementing JSON-LD it's worth a look at the example Shopify JSON-LD from Feedarmy it's a decent starting point to help understand how others are tackling this same problem (or literally just use it).
Thanks for your help!
I think I found the code that is responsible for this issue. Wouldn't it be much easier to just delete or change part of it? I have no idea what part to change though. I assume the part that says "name" : "product.title" or maybe "variant.title" but it seems correct. Here is a screen shot of that:
Yeah probably easier to change! There's going to be more than one way to fix this, and there are pretty loose rules around schema implementations. Here's a couple suggestions.
It looks like the code in that snip loops through all the variants and sets up itemOffered for each.
A quick way to test is something like using ScreamingFrog on a listcrawl mode with say 5 live products. Then change, recrawl the short list and see how the output changes, refine a bit etc. There's some good documentation here for context as it relates to Google Search https://developers.google.com/search/docs/data-types/product#json-ld
When you have it looking better, recrawl in GSC and see how it looks there.
I just don't understand why it would change the information. It's like it's pulling that info from somewhere else and overriding the information I supplied. I also noticed that it isn't just changing the name, the prices are all missing the second zero, like this 150.0 instead of 150.00. Google provided a line number for where it is getting that information but the line number is in three thousands and none of the code files go anywhere near that high. Where can I find that part of the code?
Why is it evaluating every product and variant twice? The products with variants are listed first with the warnings and no errors, with the correct names and then below that, it has each variant again but with the warnings (again) and the errors and referring to them as if the size is the name of the product. The products that don't have a variant, it lists the products and warnings and then below that it lists the product and its warnings (again) plus the errors and refers to the products by the name "default title."
I just don't understand why it would change the information. It's like it's pulling that info from somewhere else and overriding the information I supplied.
Yeah it doesn't sound like that JSON-LD code is robustly tested, probably other things to clean up in there too. Or there could be other schema like RDFa or Microdata within the page that is getting pulled in by GSC and generating these errors. Really hard to pinpoint the exact issues here by looking at pieces of information like the source code in isolation without the context of exploring the site, the crawls and the GSC errors hands-on. Also I'm just trying to throw out some off-the cuff ideas to you without all the information so quite possible that I'm leading you down the wrong rabbit hole, although trying not to.
I also noticed that it isn't just changing the name, the prices are all missing the second zero, like this 150.0 instead of 150.00. Google provided a line number for where it is getting that information but the line number is in three thousands and none of the code files go anywhere near that high. Where can I find that part of the code?
If the price data is being output with unusual decimal points, it could (maybe) be another thing in the Liquid code to clean up. There are Liquid filters that control the rounding, but I haven't really looked. The GSC line numbers correspond to the DOM not the theme files. To debug this properly, it would help to have a good understanding of how GSC crawls, parses and generates errors, browser dev-tools and Liquid + Shopify themeing. Unfortunately there's not really a structured process to follow here that I can say do x then y then z and fixed. Debugging theme and errors like this are always bit ad-hoc and exploratory.
Why is it evaluating every product and variant twice? The products with variants are listed first with the warnings and no errors, with the correct names and then below that, it has each variant again but with the warnings (again) and the errors and referring to them as if the size is the name of the product. The products that don't have a variant, it lists the products and warnings and then below that it lists the product and its warnings (again) plus the errors and refers to the products by the name "default title."
I was referring to this very problem when I suggested to you might want to look at conditionally handling the "default product" case differently. You need to understand the Shopify Product > Variant relationship and also how loops work in liquid and also be somewhat familiar with GSC schema expectations to start to understand what's going on here before constructing a valid fix. It's normal to setup each variant as a kind of nested offer within JSON-LD primary product that's a perfectly valid approach, which it looks like the code has tried to do (badly).
Thank you so much for your response!! Unfortunately, my understanding of liquid is very limited. So, I guess I will try to see what I can do/find out using dev tools. Now that you know a little bit more about my issue, do you still suggest I give that feedarmy fix a try? Or maybe write my own template for the products?
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024