Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in breadcrumb schema markup #1362

Merged
1 commit merged into from
Oct 8, 2018
Merged

Fix errors in breadcrumb schema markup #1362

1 commit merged into from
Oct 8, 2018

Conversation

sacr3dc0w
Copy link
Contributor

@sacr3dc0w sacr3dc0w commented Sep 26, 2018

What?

In late August, Google updated how they processed breadcrumbs, causing schema markup to begin throwing errors when you run a site through their structured data testing tool.

Notice:

While this PR resolves those errors, it will require {{url}} being made available for the last Breadcrumbs Object I'm not sure what that would take on your guys end, but here's the code that will help cross the finish line once that's made available.

Screenshots

Before
1 before

With the fix, not quite fully resolved.
2 almost

With the fix and a URL plugged into the meta tag, fully resolving the errors thrown.
3 done

@bigbot
Copy link

bigbot commented Sep 26, 2018

Autotagging @bigcommerce/storefront-team @davidchin

@sacr3dc0w sacr3dc0w changed the title Fix broken breadcrumb schema markup Fix errors in breadcrumb schema markup Sep 26, 2018
@ghost
Copy link

ghost commented Oct 8, 2018

LGTM.

@ghost ghost merged commit 47729bc into bigcommerce:master Oct 8, 2018
@sacr3dc0w sacr3dc0w deleted the breadcrumbs branch October 8, 2018 20:42
@Tiggerito
Copy link
Contributor

The first position should be 1 (however things still work with a zero):

https://developers.google.com/search/docs/data-types/breadcrumb
"The position of the breadcrumb in the breadcrumb trail. Position 1 signifies the beginning of the trail."

https://schema.org/BreadcrumbList
"The specific values of 'position' are not assigned meaning for a BreadcrumbList, but they should be integers, e.g. beginning with '1' for the first item in the list."

The inclusion of the current page at the end of the breadcrumb is optional with regard to Google and getting breadcrumb rich snippets. However, the schema spec indicates it is "typically" included:

https://schema.org/BreadcrumbList
"A BreadcrumbList is an ItemList consisting of a chain of linked Web pages, typically described using at least their URL and their name, and typically ending with the current page."

I personally don't bother to include it as it is a bit of a fiddle to do. The url parameter would be great for this and other issues I have.

In the above final example the last name should be the product name. I presume that was just a copy paste thing just for the example.

To be honest, I remove all structured data added by the BC themes and add it using our own json-ld code. It's easier to do that than hunt through the microdata making fixes. It would be nice to have an option to switch off all structured data added by a theme.

@carsonreinke
Copy link
Contributor

@Tiggerito I second the JSON-LD use. Maybe an option to switch between Microdata, JSON-LD, or none.

@Tiggerito
Copy link
Contributor

On issue I encounter at times is that third party tools like review systems may use json-ld or microdata for their markup. If that is in a different syntax to what the theme uses, it is not possible to link the entities being defined (In Google at the moment). e.g. the product entity does not link to its review entities. Breaking a major reason for structured data, which is to define how entities relate to each other.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants