What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: Missing field "aggregateRating"

Solved

How can I fix the 'Missing field aggregateRating' error in Google search console?

evergreengolfer
Excursionist
13 0 5

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. 

Accepted Solution (1)
AlexHodzitsky
Shopify Partner
73 19 27

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:

Click to expand...
{%- 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

I didn't choose the Shopify, the Shopify chose me.
Linkedin: alex-hodzitsky

View solution in original post

Replies 16 (16)

AlexHodzitsky
Shopify Partner
73 19 27

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

I didn't choose the Shopify, the Shopify chose me.
Linkedin: alex-hodzitsky
evergreengolfer
Excursionist
13 0 5

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. 

 

Screen Shot 2021-05-06 at 1.17.04 PM.png

AlexHodzitsky
Shopify Partner
73 19 27

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:

Click to expand...
{%- 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

I didn't choose the Shopify, the Shopify chose me.
Linkedin: alex-hodzitsky
evergreengolfer
Excursionist
13 0 5

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".

evergreengolfer
Excursionist
13 0 5

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. 

evergreengolfer
Excursionist
13 0 5

Still having issues on this and wanted to open it up to all on Shopify for help if possible. 

KieranR
Shopify Partner
398 34 121

@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: 

  • is your theme or existing customizations around schema
  • any apps that are generating schema
  • any GTM code or any JS that is generating schema
  • do you have multiple types of schema like Metadata and JSON-LD? 

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. 

Part time Shopify SEO, based in NZ. Sometimes freelance outside the 9-5.
Yvette5
Visitor
2 0 0

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

KieranR
Shopify Partner
398 34 121

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.

Part time Shopify SEO, based in NZ. Sometimes freelance outside the 9-5.
Yvette5
Visitor
2 0 0

Hi Kieran,

 

woo!! Thanks!! Do you have any recommendations for a good app?

 

Let me know 🙂 

 

 

KieranR
Shopify Partner
398 34 121

@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. 

Part time Shopify SEO, based in NZ. Sometimes freelance outside the 9-5.
evergreengolfer
Excursionist
13 0 5

Alex, 

Thanks for your reply, was able to figure out were to implement the code that you provided. This has solved my problem, cheers!

rose014
Visitor
2 0 0

Hello, where did you implement the code? tried this as well but still receiving the error. Hope you can help. Thanks!

KieranR
Shopify Partner
398 34 121

@rose014 everyone's theme and implementation of this is going to be context dependent on the theme code and structure.  

Part time Shopify SEO, based in NZ. Sometimes freelance outside the 9-5.
jclemen14
New Member
4 0 0

Can I pay somebody to implement this code for me? Please!

sweetcassie
Tourist
10 0 3

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