bigcommerce / cornerstone

The BigCommerce Cornerstone theme
https://developer.bigcommerce.com/stencil-docs
287 stars 605 forks source link

Rich snippets issue: Missing field 'author' #2280

Open oggede opened 1 year ago

oggede commented 1 year ago

Expected behavior

rich snippet author field should be validated

Actual behavior

https://i.imgur.com/Pe3f0iD.jpg

Steps to reproduce behavior

Install Google rich snippets, receive warning from google about no author field.

Note: Issue has been happening before. See thread https://support.bigcommerce.com/s/question/0D54O000078r9T7SAI/google-invalid-object-type-for-field-author

However, recent updates have broken fix so need new solution.

bc-vlad-dlogush commented 1 year ago

Hi, @oggede. Try updating Cornerstone to the latest version 6.7.0

oggede commented 1 year ago

Contributor

Thanks for the reply.

I'm running 6.6.0.

No changes in "Changelog" that seem to address issue either.

bc-vlad-dlogush commented 1 year ago

@mattcoy-arcticleaf Can you please tell why some changes were made in this PR: https://github.com/bigcommerce/cornerstone/pull/2138/files#diff-96d8ca73efe8524d5f50c797599f2158a4455d1914016a7eaa3fd792108931fd

mattcoy-arcticleaf commented 1 year ago

@bc-vlad-dlogush , sure thing. The first goal was to get away from having the schema be defined in tags on the elements, as this is no longer the best way to do this. Instead, we adopt the newer, LD+JSON approach, which separates the schema data from the elements, so one does not have to worry about an edit to the HTML resulting in broken schema.

As for the actual changes to the data, I don't think I changed much. Anything I did change was in an attempt to resolve some of the errors I was seeing on Cornerstone at the time. I ran several tests on my code. There was an error with price ranges that may or may not have been resolved later, but there was never an error with the author field.

@oggede , If I could have your site URL, specifically the product in question, I would be able to troubleshoot your issue.

oggede commented 1 year ago

@bc-vlad-dlogush , sure thing. The first goal was to get away from having the schema be defined in tags on the elements, as this is no longer the best way to do this. Instead, we adopt the newer, LD+JSON approach, which separates the schema data from the elements, so one does not have to worry about an edit to the HTML resulting in broken schema.

As for the actual changes to the data, I don't think I changed much. Anything I did change was in an attempt to resolve some of the errors I was seeing on Cornerstone at the time. I ran several tests on my code. There was an error with price ranges that may or may not have been resolved later, but there was never an error with the author field.

@oggede , If I could have your site URL, specifically the product in question, I would be able to troubleshoot your issue.

Thanks for the explanation Matt. I have sent you an email with my website URL. Would be great if you could do a little troubleshoot. Cheers.

mattcoy-arcticleaf commented 1 year ago

@bc-vlad-dlogush , I connected with @oggede and we were able to determine that the error was coming from a review where the user did not put a name or put something invalid. There is no error with the code :)

oggede commented 1 year ago

Confirming what @mattcoy-arcticleaf said.

Older reviews (generated by older versions of Cornerstone) that are not correctly formatted can trigger Google error messages.

Would be nice to have a feature that removes older reviews that are no longer compliant or compatible.