3

I'm not sure if I can use together in the same page the CollectionPage and Product schema types. Is this correct for a category page?

My needs for the page are:

  • to identify as a CollectionPage the current category page (because it actually is one)
  • to identify breadcrumbs for the current category page
  • to identify aggregate ratings for the current category page
  • to identify 2 single reviews for the current category page

Since the needs clarified up here, I've checked the documentation on schema.org, specifically these pages: CollectionPage, BreadcrumbList, AggregateRating. Then, I tried to implement what I need.

My current implementation:

{
    "@context":"https://schema.org",
    "@graph":[
        {
            "@type":"Organization",
            "@id":"https://www.somewebsite.com/#organization",
            "name":"Fotoregali",
            "url":"https://www.somewebsite.com/",
            "sameAs":[
                "https://www.facebook.com/somecoolwebsite",
                "https://www.instagram.com/somecoolwebsite/",
                "https://www.youtube.com/user/somecoolwebsite",
                "https://it.pinterest.com/somecoolwebsite/",
                "https://twitter.com/somecoolwebsite"
            ],
            "logo":{
                "@type":"ImageObject",
                "@id":"https://www.somewebsite.com/#logo",
                "url":"https://www.somewebsite.com/logo-or.png",
                "width":345,
                "height":84,
                "caption":"Fotoregali"
            },
            "image":{
                "@id":"https://www.somewebsite.com/#logo"
            }
        },
        {
            "@type":"WebSite",
            "@id":"https://www.somewebsite.com/#website",
            "url":"https://www.somewebsite.com/",
            "name":"Fotoregali",
            "publisher":{
                "@id":"https://www.somewebsite.com/#organization"
            },
            "potentialAction":{
                "@type":"SearchAction",
                "target":"https://www.somewebsite.com/ricerca/?q={search_term_string}",
                "query-input":"required name=search_term_string"
            }
        },
        {
            "@type":[
                "CollectionPage"
            ],
            "@id":"https://www.somewebsite.com/category/#webpage",
            "url":"https://www.somewebsite.com/category/",
            "inLanguage":"it-IT",
            "name":"category personalizzate su più supporti",
            "isPartOf":{
                "@id":"https://www.somewebsite.com/#website"
            },
            "datePublished":"2018-11-21T14:46:12+00:00",
            "dateModified":"2019-12-03T15:20:32+00:00",
            "description":"Hey this is a category description!",
            "breadcrumb":{
                "@id":"https://www.somewebsite.com/category/#breadcrumb"
            }
        },
        {
            "@type":"Product",
            "aggregateRating":{
                "@type":"AggregateRating",
                "ratingValue":"4.8",
                "reviewCount":"7441"
            },
            "description":"Hey this is a category description!",
            "name":"Category name",
            "image":"url-img-product.jpg",
            "offers":{
                "@type":"Offer",
                "availability":"http://schema.org/InStock",
                "price":"100.00",
                "priceCurrency":"EUR"
            },
            "review":[
                {
                    "@type":"Review",
                    "author":"Username",
                    "datePublished":"2011-04-01",
                    "description":"Review text here.",
                    "name":"Review title",
                    "reviewRating":{
                        "@type":"Rating",
                        "bestRating":"5",
                        "ratingValue":"1",
                        "worstRating":"1"
                    }
                },
                {
                    "@type":"Review",
                    "author":"Username",
                    "datePublished":"2011-03-25",
                    "description":"Review text here.",
                    "name":"Review title",
                    "reviewRating":{
                        "@type":"Rating",
                        "bestRating":"5",
                        "ratingValue":"4",
                        "worstRating":"1"
                    }
                }
            ]
        },
        {
            "@type":"BreadcrumbList",
            "@id":"https://www.somewebsite.com/category/#breadcrumb",
            "itemListElement":[
                {
                    "@type":"ListItem",
                    "position":1,
                    "item":{
                        "@type":"WebPage",
                        "@id":"https://www.somewebsite.com/",
                        "url":"https://www.somewebsite.com/",
                        "name":"Home"
                    }
                },
                {
                    "@type":"ListItem",
                    "position":2,
                    "item":{
                        "@type":"WebPage",
                        "@id":"https://www.somewebsite.com/category/",
                        "url":"https://www.somewebsite.com/category/",
                        "name":"Category name"
                    }
                }
            ]
        }
    ]
}

Structured Data Testing Tool results

Google's Structured Data Testing Tool (and also this other tool from Google) seems OK with my implementation (only warnings), but my doubt lies in the fact that the page with the json/ld I've built is identified at the same time as CollectionPage and Product.

Is this correct for a category page?

  • I don't quite get how a page can be about a category (collection of products) and be about a single product? – Tony McCreath Dec 14 '19 at 10:15
  • Hi @TonyMcCreath, I am trying to figure out specifically how to represent a collection of products (I made it with CollectionPage) AND also the single products in it (if necessary). Any suggestions? – vcoppolecchia Dec 19 '19 at 13:48
2

Great question and good work using the graph to link up the schema.

AFAIK, there is nothing saying you cannot do this. Closest I can find is this from Google: https://developers.google.com/search/docs/guides/sd-policies#multiple-elements-on-a-page Although not really the same situation.

I recently implemented something similar on a category page, using collectionpage, but I used itemlist, rather than product.

However, with yours when checking in Google's tool, the collectionpage and product instances are separate.

I think you should use mainEntityOfPage to bring it all together.

Might look something like this:

{
    "@context":"https://schema.org",
    "@graph":[
        {
            "@type":"Organization",
            "@id":"https://www.somewebsite.com/#organization",
            "name":"Fotoregali",
            "url":"https://www.somewebsite.com/",
            "sameAs":[
                "https://www.facebook.com/somecoolwebsite",
                "https://www.instagram.com/somecoolwebsite/",
                "https://www.youtube.com/user/somecoolwebsite",
                "https://it.pinterest.com/somecoolwebsite/",
                "https://twitter.com/somecoolwebsite"
            ],
            "logo":{
                "@type":"ImageObject",
                "@id":"https://www.somewebsite.com/#logo",
                "url":"https://www.somewebsite.com/logo-or.png",
                "width":345,
                "height":84,
                "caption":"Fotoregali"
            },
            "image":{
                "@id":"https://www.somewebsite.com/#logo"
            }
        },
        {
            "@type":"WebSite",
            "@id":"https://www.somewebsite.com/#website",
            "url":"https://www.somewebsite.com/",
            "name":"Fotoregali",
            "publisher":{
                "@id":"https://www.somewebsite.com/#organization"
            },
            "potentialAction":{
                "@type":"SearchAction",
                "target":"https://www.somewebsite.com/ricerca/?q={search_term_string}",
                "query-input":"required name=search_term_string"
            }
        },
        {
            "@type":[
                "CollectionPage"
            ],
            "@id":"https://www.somewebsite.com/category/#webpage",
            "url":"https://www.somewebsite.com/category/",
            "inLanguage":"it-IT",
            "name":"category personalizzate su più supporti",
            "isPartOf":{
                "@id":"https://www.somewebsite.com/#website"
            },
            "datePublished":"2018-11-21T14:46:12+00:00",
            "dateModified":"2019-12-03T15:20:32+00:00",
            "description":"Hey this is a category description!",
            "breadcrumb":{
                "@id":"https://www.somewebsite.com/category/#breadcrumb"
            }
        },
        {
            "@type":"Product",
            "mainEntityOfPage":{"@id":"https://www.somewebsite.com/category/#webpage"},
            "aggregateRating":{
                "@type":"AggregateRating",
                "ratingValue":"4.8",
                "reviewCount":"7441"
            },
            "description":"Hey this is a category description!",
            "name":"Category name",
            "image":"url-img-product.jpg",
            "offers":{
                "@type":"Offer",
                "availability":"http://schema.org/InStock",
                "price":"100.00",
                "priceCurrency":"EUR"
            },
            "review":[
                {
                    "@type":"Review",
                    "author":"Username",
                    "datePublished":"2011-04-01",
                    "description":"Review text here.",
                    "name":"Review title",
                    "reviewRating":{
                        "@type":"Rating",
                        "bestRating":"5",
                        "ratingValue":"1",
                        "worstRating":"1"
                    }
                },
                {
                    "@type":"Review",
                    "author":"Username",
                    "datePublished":"2011-03-25",
                    "description":"Review text here.",
                    "name":"Review title",
                    "reviewRating":{
                        "@type":"Rating",
                        "bestRating":"5",
                        "ratingValue":"4",
                        "worstRating":"1"
                    }
                }
            ]
        },
        {
            "@type":"BreadcrumbList",
            "@id":"https://www.somewebsite.com/category/#breadcrumb",
            "itemListElement":[
                {
                    "@type":"ListItem",
                    "position":1,
                    "item":{
                        "@type":"WebPage",
                        "@id":"https://www.somewebsite.com/",
                        "url":"https://www.somewebsite.com/",
                        "name":"Home"
                    }
                },
                {
                    "@type":"ListItem",
                    "position":2,
                    "item":{
                        "@type":"WebPage",
                        "@id":"https://www.somewebsite.com/category/",
                        "url":"https://www.somewebsite.com/category/",
                        "name":"Category name"
                    }
                }
            ]
        }
    ]
}
| improve this answer | |
  • Thanks for your kind words and for your suggestions! I think I'll give a try to your idea because, as you say, this creates a single instance instead of two separate instances. While searching for further answers online, I've found this other testing tool from Google: I've tested both mine and yours version of the schema implementation and both output the same elements; I guess Google is satisfied with both of them, who knows! :D – vcoppolecchia Dec 13 '19 at 14:12
2

Google's most related guideline is for Carousels (used to be called lists):

https://developers.google.com/search/docs/data-types/carousel

What I think your talking about is "Summary page + multiple full details pages". The category summarises a list of products that are fully defined on different pages.

With this, Google states they only want you to mark up a list of URLs to each product.

If you want to include CollectionPage then you can set its mainEntity to the ItemList as suggested by Google above. You can also name the CollectionPage with the name of the category.

The way you connected the breadcrumb to the CollectionPage looks good.

Googles guide indicates they don't want you to mark up full products and with that reviews, offers etc. They want that detail to be on the products own page.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.