Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Having an issue with my Shopify store when looking at the Google search console. On Google I get an error Missing field "aggregateRating" that affects four of my items. Not sure how to resolve this issue.
Solved! Go to the solution
This is an accepted solution.
In general, the aggregate review field is added on your store, it just supposedly duplicates the product, and does not add information to the main one. And in this app, this is a problem that everyone faced.
The problem should be solved if you add such a piece of code to the sections/product-template.liquid file somewhere near the output of the product title:
{%- assign review_rating = false -%}
{% if product.metafields.spr.reviews %}
{% capture review_data %}{{ product.metafields.spr.reviews }}{% endcapture %}
{%- assign rating_keyword = '"ratingValue":' -%}
{%- assign rd_a1 = review_data | split: rating_keyword -%}
{%- assign rd_a2 = rd_a1[1] | split: "," -%}
{%- assign rd_a3 = rd_a2[0] | replace: '"', "" -%}
{%- assign review_rating = rd_a3 | plus: 1 | minus: 1 -%}
{%- assign count_keyword = '"reviewCount":' -%}
{%- assign rd_a1 = review_data | split: count_keyword -%}
{%- assign rd_a2 = rd_a1[1] | split: "," -%}
{%- assign rd_a3 = rd_a2[0] | replace: '"', "" -%}
{%- assign review_count = rd_a3 | plus: 1 | minus: 1 -%}
{% endif %}
{%- if review_rating %}
<div itemprop="aggregateRating" itemscope="" itemtype="https://schema.org/AggregateRating">
<meta itemprop="ratingValue" content="{{ review_rating }}">
<meta itemprop="reviewCount" content="{{ review_count }}">
</div>
{%- endif -%}
Hope this helps.
Alex
Hi evergreengolfer! Hope you are doing well!
This field is responsible for the average rating of the product, you can see more information here -> https://schema.org/AggregateRating. Basically, the app responsible for the review already specify this field by default. What App do you use for product reviews? Can you provide a link to your store and the problematic product in general?
Alex
Alex,
Thanks for the quick response. The app we use for product reviews is the Product Reviews app from Shopify. I've provided a link to my store zipr.com and screens hotted the problematic links below. Thanks.
This is an accepted solution.
In general, the aggregate review field is added on your store, it just supposedly duplicates the product, and does not add information to the main one. And in this app, this is a problem that everyone faced.
The problem should be solved if you add such a piece of code to the sections/product-template.liquid file somewhere near the output of the product title:
{%- assign review_rating = false -%}
{% if product.metafields.spr.reviews %}
{% capture review_data %}{{ product.metafields.spr.reviews }}{% endcapture %}
{%- assign rating_keyword = '"ratingValue":' -%}
{%- assign rd_a1 = review_data | split: rating_keyword -%}
{%- assign rd_a2 = rd_a1[1] | split: "," -%}
{%- assign rd_a3 = rd_a2[0] | replace: '"', "" -%}
{%- assign review_rating = rd_a3 | plus: 1 | minus: 1 -%}
{%- assign count_keyword = '"reviewCount":' -%}
{%- assign rd_a1 = review_data | split: count_keyword -%}
{%- assign rd_a2 = rd_a1[1] | split: "," -%}
{%- assign rd_a3 = rd_a2[0] | replace: '"', "" -%}
{%- assign review_count = rd_a3 | plus: 1 | minus: 1 -%}
{% endif %}
{%- if review_rating %}
<div itemprop="aggregateRating" itemscope="" itemtype="https://schema.org/AggregateRating">
<meta itemprop="ratingValue" content="{{ review_rating }}">
<meta itemprop="reviewCount" content="{{ review_count }}">
</div>
{%- endif -%}
Hope this helps.
Alex
Alex.
I tired copying the code and pasting it into the sections/product-template.liquid and when re-running the Google search console am still encountering the same issue, Missing field "aggregateRating".
Still quite confused on a solution to the issue, have look around the discussion board to look at similar issues, and have found that I am unable to fully understand a solution to the ones that I have looked up. Any help would be highly appreciated, thanks.
Still having issues on this and wanted to open it up to all on Shopify for help if possible.
@evergreengolfer this is a theme implementation issue which will be specific to your unique store, theme, config and likely require at least a bit of hands-on time to get it working correctly. Try Shopify support you may get lucky which could work out, but I wouldn't hold my breath - as I'd see this as one of those things that's "out of scope" for them to fix.
The simple answer is that to fix it - add aggregateRating field.
The longer answer is that the actual technical implementation to add that will depend on:
In most cases I find the quickest fix to get a good (and working!) schema setup is to dig into the theme, read the code and understand what's going on in context, maybe quick crawl a few pages on ScreamingFrog and check what's happening, then surgically remove out any schema without breaking stuff. Then replace with an app like JSON‑LD for SEO or Schema Plus for SEO and set it to pull review data from Shopify Product Reviews (SPR). If you already have a good handle on HTML, JSON, Liquid etc, it's not technically difficult to write your own schema/JSON code to do this yourself, or tweak your own theme. But you need to have a decent understanding of JSON, HTML, Liquid, Shopify etc to DIY, and it's just time consuming and finicky to get right. These apps give you a really decent head start and give you really robust schema.
If you just install one of those apps, you may actually get lucky and it could work, depends on your theme etc. But it's quite likely they will end up creating duplicate schema, not a major but still not an perfect fix.
In saying all that, if you want to edit your own theme code, can you please find the existing schema code and paste it in here, then I can try add some suggestions. If you are unable to even find it, well frankly, I'd be concerned that you should be editing your own code at all... but start exploring around the product templates.
Hi all!
Unfortunatly, I have the same problem.
My webshop is not indexed by Google because of the following problems.
How can I fix this? 😞
- price valid until
- review
- aggregateRating
- Gtin/mpn/isbn
Hey @Yvette5. So lack of schema or schema warnings won't prevent your site from being 'indexed'.
If your store is new, it can take some time to begin to be indexed. I've noticed anywhere from a couple days to a couple months is normal on a site with a fresh domain (no authority) to start to show up in google results at all.
But to fix those issues, you need to fix schema. Roughly the same answers as above. Edit theme or add an app that mostly does this for you.
Hi Kieran,
woo!! Thanks!! Do you have any recommendations for a good app?
Let me know 🙂
@Yvette5 yep from earlier in the thread:
In most cases I find the quickest fix to get a good (and working!) schema setup is to dig into the theme, read the code and understand what's going on in context, maybe quick crawl a few pages on ScreamingFrog and check what's happening, then surgically remove out any schema without breaking stuff. Then replace with an app like JSON‑LD for SEO or Schema Plus for SEO and set it to pull review data from Shopify Product Reviews (SPR). If you already have a good handle on HTML, JSON, Liquid etc, it's not technically difficult to write your own schema/JSON code to do this yourself, or tweak your own theme. But you need to have a decent understanding of JSON, HTML, Liquid, Shopify etc to DIY, and it's just time consuming and finicky to get right. These apps give you a really decent head start and give you really robust schema.
Alex,
Thanks for your reply, was able to figure out were to implement the code that you provided. This has solved my problem, cheers!
Hello, where did you implement the code? tried this as well but still receiving the error. Hope you can help. Thanks!
@rose014 everyone's theme and implementation of this is going to be context dependent on the theme code and structure.
Can I pay somebody to implement this code for me? Please!
Hello, this is Cassie, I too have this issue (missing field aggregateRating). I tried your solution, to copy paste code to the product template. However, I cannot find the product title area to paste the code nxt to. Below is how my code starts (it's very long and involved, but nowhere is there a PROUDUCT TITLE section).
{%- capture section_settings -%}
{
"enableHistoryState": true,
"templateSuffix": {{ product.template_suffix | json }},
"showInventoryQuantity": {{ section.settings.show_inventory_quantity | json }},
"showSku": {{ section.settings.show_sku | json }},
"stackProductImages": {{ section.settings.stack_images | json }},
"showThumbnails": {{ section.settings.show_thumbnails | json }},
"enableVideoLooping": {{ section.settings.enable_video_looping | json }},
"inventoryQuantityThreshold": {{ section.settings.inventory_quantity_threshold }},
"showPriceInButton": {{ section.settings.show_price_in_button | json }},
"enableImageZoom": {{ section.settings.enable_image_zoom | json }},
"showPaymentButton": {{ section.settings.show_payment_button | json }},
"useAjaxCart": {% if settings.cart_type == 'drawer' %}true{% else %}false{% endif %}
}
{%- endcapture -%}
Can you help? I can add the complete code if you need. Thanks in advance
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024