Either "offers", "review", or "aggregateRating" should be specified - Google Error

Damian_Rushwort
New Member
16 0 0

Hi

 

I'm getting the following error showing against all my products in the Google search console.

 

Either "offers", "review", or "aggregateRating" should be specified.

 

Anyone seen this before / know how to resolve? 

 

Damian 

Replies 268 (268)

Visely-Team
Shopify Partner
1843 210 488

Hey Damian,

 

Most probably some of the HTML code is using attributes like 

itemtype="http://schema.org/Product"

without actually providing the attributes mandatory for Google (https://developers.google.com/search/docs/data-types/product) like the list you've mentioned. Depending on the case, you might want to just add theses attributes to your HTML or remove the itemtype altogether.

 

If you can share the URL to your store I'll be able to advise the best option for you.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
Damian_Rushwort
New Member
16 0 0

Hi

 

Thanks for the quick reply.

 

https://itzoo.co.uk/

 

Damian 

Visely-Team
Shopify Partner
1843 210 488

OK, so one of the product warnings is pointing to a code related to Quick View plugin, which is not event used on product pages:

<div id="sca-qv-showqv">
    <div itemscope="" itemtype="http://schema.org/Product">
...
</div>

you might want to find that piece of code within the Theme code editor and remove this part.

 

I checked a couple of product pages for errors related to the "Either "offers", "review", or "aggregateRating" should be specified." but all of them had the "offers" attribute set. Do you have a couple of URLs to product pages where you see the error in Google console?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
upanicbd
Visitor
1 0 0

Hi! I am having the same problem.

Search Console says that "aggregateRating" "review" fields are missing in my 3 products.

And also: "No international identifier has been provided, such as a GTIN, MPN, or ISBN"

If you can help me would be amazing.

The URLs are:

 https://upanidecbd.com/products/luna-nueva-aceite-cbd-500mg

https://upanidecbd.com/products/luna-creciente-aceite-cbd-1000mg

https://upanidecbd.com/products/luna-llena-aceite-cbd-2000mg

Thanks in advance!

 
 
 
EmmanuelFlossie
Shopify Partner
2997 223 719

If you are using Shopify default review mechanic. Simply install the code, easy to follow tutorial: https://feedarmy.com/kb/shopify-microdata-for-google-shopping/

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
KayB
Visitor
2 0 0

Hello, 

Can someone please assist me. I received these errors and messages on Google Search Console and I'm not certain on how to resolve this. 

Thank you,

Kay 

 

Screen Shot 2021-01-18 at 10.43.35 AM.png

EmmanuelFlossie
Shopify Partner
2997 223 719

And have you installed the structured data? I have a helpful link in my previous post.

You can test the results here: https://search.google.com/test/rich-results

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
KayB
Visitor
2 0 0

I tested the results and I have 2 Errors and and 5 Warnings as seen below. I don't know how and where to edit these issue and I'm hoping to receive a detailed instruction on how to do this.

 

Thank you,

Kay

 
Either "offers", "review", or "aggregateRating" should be specified
Missing field "name"
 
Missing field "image" (optional)
Missing field "sku" (optional)
Missing field "brand" (optional)
Missing field "description" (optional)
No global identifier provided (e.g., gtin, mpn, isbn) (optional)

 

EmmanuelFlossie
Shopify Partner
2997 223 719

It would be amazing if I could easily provide you with detailed instructions. I think everyone would love that. Unfortunately, the reality is different.

Each merchant has different settings and different issues.

If I need to write instructions to cover all potential issues, I would be writing a whole day. My volunteer support can only go so far.

So after installing the code and you have issues, either the code was not correctly installed or you have not added the required data.

If after this you still struggle, I do provide a service to assist you.

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
everythingblack
Visitor
2 0 0

Hi,

 

I tried doing so and after testing according Step 7 I did not see any warning.

When going to Google Search Console and trying to validate the Fix, this still gives the same error.

EmmanuelFlossie
Shopify Partner
2997 223 719

Check what the issues are, and resolve the individual issue.


For example if the issue is related to product identifiers, my code will not magically resolve it. You need to ensure you add bar codes in Shopify with the vendor value. Then my code will be able to show it.

My recommendation, step by step check what issues you have, check what you need to do to resolve it.

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
TrudyB
Visitor
2 0 0

I am having the Same Issue

WhatnotGems.com

EmmanuelFlossie
Shopify Partner
2997 223 719

There are lots of solutions provided @TrudyB have you tried it?

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
wdg1258
New Member
4 0 0

 

We are having the same frustrating problem!  Also an error about "name"  Can someone help?  Our domain is joeyhemp.com 

 



Capture.PNG

  

 

 

Visely-Team
Shopify Partner
1843 210 488

Can you share a couple of concrete URLs for which the console reports errors like below?

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
wdg1258
New Member
4 0 0

Sure!

Here are 4 out of a list of 29 URL's where this is happening.  I asked Google to recrawl one of them so check on validity again in case some of the things we tried have maybe fixed the problem.  Your insight is greatly appreciated. 

 

 

Visely-Team
Shopify Partner
1843 210 488

That is odd. Their structured data testing tool does not report these errors - https://search.google.com/structured-data/testing-tool/u/0/#url=https%3A%2F%2Fjoeyhemp.com%2Fcollect...

 

I can see the "offers" field.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
wdg1258
New Member
4 0 0

it could very well be that error message is outdated.  The last crawl Google did on those pages with errors was a week and a half ago.  I have asked it to check our fixes we've tried over the last two weeks.  Maybe it is fixed after all!  I will let you know as soon as I see the new results from Google. 

Visely-Team
Shopify Partner
1843 210 488

Yup, usually the structured data test tool is faster to spot the fixes, thought it also has some caching. Good luck!

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
wdg1258
New Member
4 0 0

While I'm waiting on those results...can you shed some light on what we could do about these warnings showing up Structured Data test?

 

This product actually has a review posted. 

Capture.PNG

Visely-Team
Shopify Partner
1843 210 488

If you click on aggreatedRating line in the right hand side panel it'll take you to the exact line on the left hand side panel. You'll have to make sure the product data are populated as per -https://developers.google.com/search/docs/guides/intro-structured-data - You can see an example of a value for aggreatedRating.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
Nicola_Johnston
New Member
4 0 0

Hi There,

I'm also have the same errors.

Some of my URLS are

https://oceanluxe.com.au/products/natural-nautilus-shell-ring

https://oceanluxe.com.au/products/palm-beach-quilt

https://oceanluxe.com.au/products/black-beaded-chandelier

https://oceanluxe.com.au/products/byron-visor

 

However under Google Structured Data testing it is showing no errors or warnings.

Help!

Capture123.JPG

2Sher
Visitor
2 0 0

I have the same problem too. Can someone please guide me what should I do. 

 

https://smartghar.pk/collections/switch

 

Screenshot 2019-09-03 at 12.27.01.png

Visely-Team
Shopify Partner
1843 210 488

@Nicola_Johnston you'll have to find the code snippet responsible for rendering the structured data and make sure it populates the missing fields. Also, the "errors" regarding "offers, reviews and aggregatedRating" are actually warnings, so you can live with them. The one error I see for these pages that worths looking into is "A value for the name field is required." for some of the product in the related products section. Just locate the code snippet that renders the HTML and remove the attributes:

itemscope itemtype="http://schema.org/Product" 

from:

<div class="product-template__container page-width" itemscope itemtype="http://schema.org/Product" id="ProductSection-related-products" data-section-id="related-products" data-section-type="product" data-enable-history-state="true">
Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
FootPlacard
Visitor
2 0 0

Hello beautiful community,

our store is facing two error and i would appreciate your  help on this : 

Error
 
Either "offers", "review", or "aggregateRating" should be specified
 
Not Started
 
 
19
 
Error
 
Missing field "name"
 
Not Started
 
 
19


our website is www.footplacard.com 

and here are some of the affected items:

N/A
 
Sep 4, 2019
 
N/A
 
Sep 4, 2019
 
N/A
 
Sep 4, 2019
 



Thanks in Advance 

Dustin_Lee
New Member
6 0 0

Hi everyone!

I'm experiencing this issue on all product pages as well. Here's a screenshot. 

2019-09-16_19-49-04.png

 

Here are a few product pages it's occurring on:

https://www.retrosupply.co/products/gouache-shader-brushes-for-adobe-illustrator

https://www.retrosupply.co/collections/procreate/products/the-i-want-all-of-the-procreate-brushes-bu...

https://www.retrosupply.co/collections/adobe-photoshop/products/woodland-wonderland-brush-tutorial-p...

 

Any help would be hugely appreciated!

Thank you!

Guy_Beardsley
Tourist
10 0 3

Did you fix this in the end? I have the exact same errors on my page!

GeoffH
Shopify Partner
13 0 4

Like many other people that have posted on this topic our website is outputting JSON product data and the Shopify reviews are also outputting JSON data. I have complete control over the product data as that is in liquid code, but maybe someone from Shopify could answer why there are settings for me to adjust the colour of the stars or which fields are mandatory or the exact wording of the message the user is shown on completion but there is no setting to stop the review module outputting JSON data. Surely it is better to not write the JSON data to the document than expect owners of Shopify sites to implement a bodge where they wait for the review module to finish writing to the page before deleting the content that has just been added.

maknij
Excursionist
29 0 6

Hi Geoff

Same issue my side - when I was still using the Supply theme then adding this to my theme.liquid removed the JSON data outputted by Shopify Product Reviews:

<script>
var SPRCallbacks = {
onProductLoad: function( e ) {
$('#shopify-product-reviews [type="application/ld+json"]').remove();
},
onReviewsLoad: function( e ) {
$('#shopify-product-reviews [type="application/ld+json"]').remove();
}
}
</script>

I've since moved to the paid Warehouse theme and no matter what I do this workaround doesn't work for me anymore and I'm stuck with the Shopify Product Review JSON messing up my metadata causing my reviews to no longer appear in my Google rich snippets.

Not sure if anyone has any ideas?

GeoffH
Shopify Partner
13 0 4

Just so happens we are also on warehouse. The way I did it was to detect that a change had occurred to the page and then use that mutation to remove the content. I still don't know why Shopify don't have an option for the reviews app to not output JSON data, but given they don't this the code you want:

 

            {% if reviews_count > 0 %}
              <script>
              var target = document.getElementById('shopify-product-reviews')
              
              var observer = new MutationObserver(function(mutations) {
                $('#shopify-product-reviews [type="application/ld+json"]').remove();
              });

              var config = { attributes: true, childList: true, characterData: true };
              observer.observe(target, config);
              </script>
            {%- endif -%}

 

 

It needs to go in product-template.liquid just before the endif that belongs to if section.settings.enable_reviews.
Where review_count has a few lines earlier been defined as (likely to be a change to the original code in the theme, unless they have updated since we had it):

 

{%- assign reviews_count = product.metafields.spr.reviews | split: '"reviewCount": "' | last | split: '"' | first | plus: 0 -%}

 

 

Hope that helps.

naz2
Tourist
3 0 1

I follow all steps below but i still see this in my serach console! "aggregateRating" should be specified

Here is my schema which i put in my theme.liquid

<script type="application/ld+json"</script>
<script>
{
"@context": "http://schema.org",
"@type": "Product",
"offers": {
"@type": "Offer",
"availability":"https://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}",
"price": "{{ current_variant.price | divided_by: 100.00 }}",
"priceCurrency": "{{ cart.currency.iso_code }}",
"priceValidUntil": "{{ 'now' | date: '%s' | plus: days_price_valid_until | date: '%Y-%m-%d'}}",
"url": "{{ shop.url }}{{ product.url }}"
},
"brand": {{ product.vendor | json }},
"sku": {{ current_variant.sku | json }},
"name": {{ product.title | json }},
"description": {{ product.description | strip_html | json }},
"category": "",
"url": "{{ shop.url }}{{ product.url }}",
{%- if is_barcode_available and is_valid_gtin_length %}
"{{gtin_option}}": {{ current_variant.barcode | json }},
"productId": {{ current_variant.barcode | json }},
{%- elsif is_barcode_available %}
"mpn": {{ current_variant.barcode | json }},
"productId": {{ current_variant.barcode | json }},
{%- endif -%}
{%- if review_count > 0 -%}
"aggregateRating": {
"@type": "AggregateRating",
"itemReviewed": {{ product.title | json }},
"bestRating": "5",
"worstRating": "1",
"ratingValue": "{{ review_rating }}",
"reviewCount": "{{ review_count }}"
},
{%- endif %}
"image": {
"@type": "ImageObject",
"url": "https:{{ product.featured_media.preview_image | img_url: '1024x1024' }}",
"image": "https:{{ product.featured_media.preview_image | img_url: '1024x1024' }}",
"name": {{ product.title | json }},
"width": 1024,
"height": 1024
}
}
</script>
</head>

 

And i put this code into my product.template.liquid file

{% if section.settings.display_product_reviews or section.settings.show_sold_in %}
<div class="group_item">
{% if section.settings.display_product_reviews %}
<span class="shopify-product-reviews-badge" data-id="{{ product.id }}"></span>
{% if reviews_count > 0 %}
<script>
var target = document.getElementById('shopify-product-reviews')

var observer = new MutationObserver(function(mutations) {
$('#shopify-product-reviews [type="application/ld+json"]').remove();
});

var config = { attributes: true, childList: true, characterData: true };
observer.observe(target, config);
</script>

{%- 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 reviews_count = product.metafields.spr.reviews | split: '"reviewCount": "' | last | split: '"' | first | plus: 0 -%}
{%- 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 %}
</script>

What is the problem in these codes?

GeoffH
Shopify Partner
13 0 4

I suspect if you look at the source HTML or Google console for that matter you will see that you have two blocks of JSON data one for the product which contains the review information correctly and one for the reviews without the product data that is incomplete. This I suspect is because the content added by the Shopify review app is still there and I suspect that is because the suggested code I put forward was specific to the theme we are using and includes the ID of a div that is in our theme. If a different theme doesn't have the same ID then it is going to fail to find the DIV, which will mean it can't delete it.

Nicola_Johnston
New Member
4 0 0

Thank you 

 

Would you know what snippet this would be in? I've searched through all and can't find the specific line of code

Visely-Team
Shopify Partner
1843 210 488

hey @Nicola_Johnston it might take a while for Google Console to update. As you said, structured data testing tool doesn't show the errors, more over, you can see the "offers" field is being provided.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
rajdip
Visitor
1 0 0

Hi visely-team. i am also having the same issue. Can you help me out? my domain is aenaturals.in and theme used is cospora.

Edys
Visitor
1 0 0

Hi there, 

Sergiu Svinarciuc | CTO @visely.io

I have the above mentioned error message also. I don't have the same code in the old shopify product.liquid template, but I find this one which can be interring with the new code.

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">

<meta itemprop="priceCurrency" content="{{ shop.currency }}">

<link itemprop="availability" href="http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}">

 

Any suggestion? Thank you!!

GalaxyDM
Visitor
1 0 0

Hello,

 

I'm getting the same thing from google for Wedding Rings

for all my products

 

One of offers or review or aggregateRating should be provided.

 I have over 1,000+ products in the category.  What template can I find that in and how can I fix it? 

 

"Product",


"name" : "Default Title",


"sku": "B00GTYA7NQ",


"weight": {
"@type": "QuantitativeValue",

"unitCode": "lb",

"value": "0.0 lb"
},

"url": "https://newweddingrings.com/products/sparkling-green-colored-heart-shaped-clover-charm-neckace-210?v..."

 

 

Please help, thanks 

Akshay_V
Shopify Partner
438 16 58

@GalaxyDM 

please check your mail.

Akshay Vaghasiya | Email: hello@lavitastic.com | Skype: akshayvaghasiya84
Want to modify theme or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Buy me a coffee PayPal
Moars
Excursionist
25 1 9

Hey All,

 

Sadly enough i'm also running into this issue. i have about 49 products reporting this issue so its not all of my products. And some do have reviews while others dont. My website was made november / december so i would expect i started after the fix was implemented. What can i do to fix this issue?

An example link is added below that returns an error:

 

https://korean-skincare.nl/products/clean-it-zero-cleansing-balm-original?variant=31321779273791

 

Kind Regards,

Monica

Akshay_V
Shopify Partner
438 16 58

@Moars 

I have checked the link and I found there is few errors and code duplication error.
Reference Screenshots: 
https://prnt.sc/ql7yaz
https://prnt.sc/ql7znz
https://prnt.sc/ql8046

Reference Link: 
https://search.google.com/structured-data/testing-tool/u/0/#url=https%3A%2F%2Fkorean-skincare.nl%2Fp...

 

For this I need your store admin collaborator access and this issue is chargeable because it is time consuming task. Moreover, Once I submit update you can check solution on above reference link because Google search console take time for update its data around 15 to 20 days.

So please let me know your input.

Akshay Vaghasiya | Email: hello@lavitastic.com | Skype: akshayvaghasiya84
Want to modify theme or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Buy me a coffee PayPal
seegang-berlin
Tourist
9 0 11

WOW!
After launching my new shop on Jan 5th and instantly running into  the "offers", "review", or "aggregateRating" issue on 10 product pages I also found this long thread here. I'm using the Ella theme and Shopify's Product Review app.

 

I have the issue on the following products:
https://seegang.berlin/products/32-hair-circlet-bridal-lace-sculpture-hair-accessory-in-natural-whit...
https://seegang.berlin/products/9-hair-combs-set-bridal-jewellery-hairdos-with-rhinestones-in-gold
https://seegang.berlin/products/41-hair-circlet-bold-bridal-crown-from-high-quality-lace-with-pearls...

https://seegang.berlin/products/14-halo-hat-black-headdress-in-the-elegant-new-look-of-the-50s-this-...

https://seegang.berlin/products/52-delete-hair-circlet-bold-black-velvet-with-a-rose-and-feathers


Both with and without reviews.

Adding a review (as descriped above) did not solve my problem - actually it added one more Error. 
Before adding a new review I only had Product Error and Warnings, after I had additional AggregateRating Error and Warnings.

So also to me it looks like the problem is not solved yet. I'm not a coder and can only follow half of your discussion.

 

I did not see any response in this thread yet, whether this is gonna affect my Google ranking or not.
In other words, should I relax and wait until Shopify fixes the issue or if I should panic and switch to another Theme / Rating app.

Any insights on that?
Jenny

Moars
Excursionist
25 1 9
Hey Jenny! What a coincidence, I'm also using Ella theme. I wonder if it's related. I am using loox reviews instead though.

Alshiv above offers to do custom coding to fix it but indicated that it needed to be done for every product so I'll still have an issue if I add new ones afterwards.

I contacted support and they told me they will get back to me on it
NaomiR
Visitor
1 0 0

Same here. I'm also using the Ella theme and i am getting this error as well. 
Is this error going to remove all the products from the search results? 

If so, this should be a high priority on Shopify's bug list right?

Akshay_V
Shopify Partner
438 16 58

@NaomiR 

Hi, For your information this bug display because Google has changed its requirement of rich snippet. Moreover, Shopify is not responsible for it because it depends on which product review app and theme you are using. So if you have brought a paid theme then you can go with theme developer and ask for an update or fix the issue on your store.

If you want to fix this error then you can hire Shopify developer and ask them to update old code and solve the errors. Also, you can contact me I will fix the error on your store.

Akshay Vaghasiya | Email: hello@lavitastic.com | Skype: akshayvaghasiya84
Want to modify theme or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Buy me a coffee PayPal
EmmanuelFlossie
Shopify Partner
2997 223 719

Hello all, I have updated the aggregatedRatings issue for Shopify reviews. You can copy the latest code here: Easy To Follow Structured Data Tutorial With Updated AggregatedRatings resolved

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
Hobby-shop
Tourist
8 0 0

Hi All and Emmanuel, have you idea how to remove the new issue of automatic json-ld producted by SPR Apps?
We have tried alternative the following, but nobody work

 

<script>
var SPRCallbacks = {
onProductLoad: function( e ) {
$('[itemprop="itemreviewed"]').remove();
$('[itemprop="itemReviewed"]').remove();
$('[type="application/ld+json"]').filter(':contains("itemReviewed")').remove();

}
}
</script>

<script>
var SPRCallbacks = {
onProductLoad: function( e ) {
$('[itemprop="itemreviewed"]').remove();
$('[itemprop="itemReviewed"]').remove();
$('[type="application/ld+json"]').filter(':contains("itemReviewed")').remove();

},
onReviewsLoad: function( e ) {
$('[itemprop="itemreviewed"]').remove();
$('[itemprop="itemReviewed"]').remove();
$('[type="application/ld+json"]').filter(':contains("itemReviewed")').remove();

}
}
</script>

<script>
function watchSPR(mutations, observer) {
for (m in mutations) {
var mutation = mutations[m];
if( mutation.type == "childList" && mutation.addedNodes.length ) {
// console.log(mutation.addedNodes);
var $m = $(mutation.addedNodes);
if( $m.find('.spr-header').length ) {
$('[itemprop="itemreviewed"]').remove();
$('[itemprop="itemReviewed"]').remove();
$('[type="application/ld+json"]').filter(':contains("itemReviewed")').remove();
console.log('SPR Patched');

setTimeout( function() {
observer.disconnect();
console.log('Detaching from SPR');
}, 1000);
}
}
};
}

observer.observe(
document.getElementById('shopify-product-reviews'),
{
childList: true,
subtree: true
}
)
</script>

EmmanuelFlossie
Shopify Partner
2997 223 719

@Hobby-shop as far as my understanding goes with structured data, you can't remove inserted data after it is added. Because it is read server-side, not client-side. Hence why removing data after it is added still shows the original data.

 

The good thing is as long as you add the correct structured data before any other structured data, you should not get any warnings in Google Merchant Center or Google Search Console. As it always reads from top to bottom.

 

You may get errors if the second structured data has them, but it should in reality not prevent you from showing rich snippets on Google Search or get price / availability missmatch in Google Merchant Center.

 

Hope this helps.

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.
tim
Shopify Expert
3326 250 1199

In fact, this extra piece of json from the app does not help at all.
Structured data is read by the client (in this case we are targeting google crawler bot), so we can modify it with Javascript before it happens.
So, usual way of adding app to you page is by adding line like this:

<div id="shopify-product-reviews" data-id="{{product.id}}">{{ product.metafields.spr.reviews }}</div>

For the latest version of the app I omit the metafield content, like so:

<div id="shopify-product-reviews" data-id="{{product.id}}">/div>


This hides app data from the SDTT, but crawler will see it re-added by apps Javascript, so we later remove this newly added Jason with something like this to SPRCallbacks:

$('#shopify-product-reviews [type="application/ld+json"]').remove();

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
EmmanuelFlossie
Shopify Partner
2997 223 719

@tim with respect to bots reading client data. Unfortunately not all do. Google's shopping bot only reads server-side coding and can not read javascript edited data.

 

Other Google bots can, yes. But not Google Shopping bot.

 

As I focus on Google Shopping, I have focused on ensuring the structured data works for Google Merchant Center first.

 

Hope this helps.

Get in touch with Emmanuel: a Google Shopping Specialist, Google Ads Diamond Product Expert, and also a a Google Product Expert Education 2021 & Tailwind 2023 Award winner.
Need Google Merchant Center or Google Shopping support?.