I’ve been looking for a guide for adding google rich snippets into the header but I haven’t been able to find a guide specifically for this. For instance, I want to take the aggregate rating from an element on the page and have that be read by Google - how can I do this? Do I need to assign the rating widget a class id first?
If someone can tag me to an article that goes over this I would appreciate it so much right now.
I have shared an example of how we have implemented this for the Recipe Schema. Here’s my forum post explaining that. This should be a good starting point.
You need to pass the aggregate rating value dynamically similar to how I am passing the Recipe Name, Description and other values. I don’t think you need to add a class id as such for it, but depends on how your page is setup and where your rating data is fetched from.