如何在我的网站网址下方的Google搜索结果中获得星级评分

时间:2016-11-10 10:43:54

标签: php html code-snippets

我想用代码来获取它们。不与谷歌评论,因为人们需要有一个谷歌帐户。我查看了schema.org,但我得不到它。

所以我如何在我的片段中获得星星

1 个答案:

答案 0 :(得分:4)

您应该使用AggregateRating

<script type="application/ld+json">
{
    "@context" : "http://schema.org",
    "@type" : "LocalBusiness",
    "name" : "My Company",
    "url" : "http://www.mycompany.com/",
    "telephone" : "(+33) 1 23 45 67 89",
    "email" : "info@mycompany.com",
    "address" : {
        "@type" : "PostalAddress",
        "streetAddress" : "1 Rue de la Place",
        "addressLocality" : "Paris",
        "postalCode" : "75000"
    },
    "aggregateRating" : {
        "@type" : "AggregateRating",
        "ratingValue" : "4.2",
        "bestRating" : "5",
        "ratingCount" : "100"
    },
    "openingHours": "Mo-Su 00:00-00:00"
}
</script>

上面的代码段应该放在结束</html>标记之前,并且应该根据100个评分显示得分为4.2 / 5