-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Updates Dawn to use the new structured_data filter #3380
Conversation
That's a very nice update. A few notes though:
|
May I suggest this be implemented as a containerless This would allow Shopify to contextually include Organization, WebSite, Article, BreadcrumbList, FAQPage, anything else that might be useful, and adapt to best practices in future. |
Awesome, I'll take a look at the gist 🙌 This approach will let us roll out support for new features like ProductGroup and multipage (hello combined listings) without requiring theme updates
Totally, it's on the roadmap |
That's great feedback, I'll take this back to the team |
What would be the recommended way to integrate product reviews? |
@lhoffbeck , just an idea here, but what about simplifying this to:
or:
This way Shopify could automatically generate either product or blog post metadata, but also the website metadata that you guys already have ; see my Gist for all the data). That would simplify it a bit and would handle any other metadata that Google might add in the future. |
@bakura10 yeah good idea, I have it in a backlog ticket. It could be a both/and improvement along with this :)
@tairli great question! Shopify-generated data only includes information that does not require any inference. Since reviews tend to be stored as metafields and don't have a standard definition, they don't fall under this case. However, the Shopify data can be trivially extended by adding another block with the same <!-- data from {{ product | structured_data }} -->
<script type="application/ld+json">
{
"@context":"http://schema.org/",
"@id":"/products/my-product#product",
"name":"My product",
... other fields ...
}
</script>
<!-- @tairli's enhanced data -->
<script type="application/ld+json">
{
"@context":"http://schema.org/",
"@id":"/products/my-product#product",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "5",
"reviewCount": "100"
}
}
</script> |
@lhoffbeck I don't agree with that. This is what the standard rating metafield is for :). |
@bakura10 Because it's a metafield the type is standardized but not the data, so surfacing it to everyone using the filter could return the wrong values. Something we could potentially explore is adding an option in the metafield definition to surface it in structured_data 🤔 For now I'd recommend extending though. |
Makes sense, but I think this will cause us a lot of support :/. Not all review apps actually output this, so merchants will see the missing review and will just come back to us on how to add it. It would definitely be needed for merchants to have control over that. |
One edge case to look out for is 3rd party review apps, would it be worth exploring an argument expecting a specific reviews structure so we can format and use those? |
Thanks @joshistoast ! This should support 3p reviews apps already, the flow would look something like this:
App dev guidance to the merchant would be something like: if you use the structured_data filter, review app structured data works automatically. If you customize structured_data, either ensure an
Can you tell me more about what you're thinking here? |
047bf3a
to
d07e613
Compare
I'm more-so curious to overriding values in case the shape of data is odd or id I's like to change it in some way, in which case I'm sure the traditional structured data approach would be best. |
@joshistoast Gotcha. Google doesn't seem to allow for overriding values by linking multiple structured data blocks by |
d07e613
to
8861398
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the property-based SEO from this file. Google interprets this as a duplicate item when present along with ld+json: https://search.google.com/test/rich-results/result?id=6ClESn2Nb85_l_LNc1XbVA
Another reason we need to be able to override an objects properties , create custom objects*, or some sort of preprocessing in liquid.
And shopify doesn't let us override object values either , for countless business scenarios situations such as contact-for-pricing ad nausem infinity there's all the surfaces that have to be edited AND merchants then get locked out of future enhancements like the Though if there's a non-liquid workaround to that let us override ld+json with just another ld+json block containt only the slice that needs to be customized that would be just as amazing and simplify a lot of customizations by taking advantage of the *also can't use metaobjects because their access structure doesn't let use create pseudo products we could slap in. i.e. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Loving the net -71
line diff, too. :chefs-kiss:
@haroldao can you send me which page this is on? |
I imported the updated theme on my demo store |
Can you drop a link so I can take a look? |
|
No problem! Thanks for reporting it :) |
PR Summary:
Replace product and article structured data generated in the theme with structured data generated by the
structured_data
filter.Why are these changes introduced?
Updating themes to stay on the greenpath of structured data developments is currently pretty painful.
What approach did you take?
Other considerations
Decision log
Visual impact on existing themes
Testing steps/scenarios
Demo links
Checklist