大数跨境
0
0

Shopify 网站结构化数据内容更新,附最新 judge.me 模板

Shopify 网站结构化数据内容更新,附最新 judge.me 模板 Shopify 主题开发
2025-09-08
98
导读:之前写的2篇结构化数据,这两年持续都有在更新,原来大部分内容还能用,但是有些数据需要调整更新。
之前写的2篇结构化数据,这两年持续都有在更新,原来大部分内容还能用,但是有些数据需要调整更新。

这次主要更新的是,article &  product 中的模板数据,应对以下错误内容。
检查这类问题,用到一个实时更新工具:https://validator.schema.org/
只要在 shopify 中更改了,然后使用这个工具,就可以实时检测更改的效果,有没有修改成功等,可以准确的指出哪个位置少了标点符号或中英文符号不对......
在产品模板中,judge.me 将原来读取产品 review 的数据元字段更新了,导致原来的数据读不到,所以,如果有用原来元字段的,这次要更新了。
更新后:
assign review_value = product.metafields.judgeme.badge | split"data-average-rating='" | last | split"'" | first | plus: 0assign review_count = product.metafields.judgeme.badge | split"data-number-of-reviews='" | last | split"'" | first | plus: 0
product 结构化数据模板:

<script type="application/ld+json">  {      "@context": "http://schema.org/",      "@type": "Product",      "name": {{ product.title | json }},      "url": {{ shop.url | append: product.url | json }},      "image": [        {{ product.featured_media | img_url: media_size | prepend: "https:" | json }}      ],      "description": {{ product.description | strip_html | json }},      {% if product.selected_or_first_available_variant.sku != blank -%}      "sku": {{ product.selected_or_first_available_variant.sku | json }},      {%- endif %}      "review": {        "@type": "Review",        "reviewRating": {          "@type": "Rating",          "ratingValue": "{{ review_value }}",          "bestRating": "5"        },        "author": {          "@type": "Person",          "name": "kevin"        }      },       "aggregateRating": {          "@type": "AggregateRating",          "ratingValue": {{ review_value }},          "reviewCount": {{ review_count }}      },      "brand": {            "@type": "Brand",            "name": {{ product.vendor | json }}      },      "offers": [                {%- for variant in product.variants -%} {                    "@type" : "Offer",                    {%- if variant.sku != blank -%}                    "sku": {{ variant.sku | json }},                    {%- endif -%}                    {%- if variant.barcode.size == 12 -%}                    "gtin12": {{ variant.barcode }},                    {%- endif -%}                    {%- if variant.barcode.size == 13 -%}                    "gtin13": {{ variant.barcode }},                    {%- endif -%}                    {%- if variant.barcode.size == 14 -%}                    "gtin14": {{ variant.barcode }},                    {%- endif -%}                    "availability" : "http://schema.org/{% if variant.available %}InStock{% else %}OutOfStock{% endif %}",                    "price" : {{ variant.price | divided_by: 100.00 | json }},                    "priceCurrency" : {{ cart.currency.iso_code | json }},                    "priceValidUntil": {{ 'now' | date: '%s' | plus: 31536000 | date: '%Y-%m-%d' | replace:'+','%20' | json }},                    "url" : {{ request.origin | append: variant.url | json }}                                  }                      {% unless forloop.last %},{% endunless %}                  {%- endfor -%}              ]            }</script>
另附博客模板。
<script type="application/ld+json">{  "@context""https://schema.org",  "@type""Article",  "headline": {{ article.title | json }},  "image": {{ article.image | image_url | prepend: "https:" | json }},    "description":{{ article.excerpt | json }},  "datePublished": {{ article.created_at | date: '%Y-%m-%d' | replace:'+','%20' | json }},  "dateModified": {{ article.published_at | date: '%Y-%m-%d' | replace:'+','%20' | json }},  "author": {    "@type""Person",              "name""kevin"  },    "publisher": {    "@type""Organization",    "name""Data Liberate",    "logo": {      "@type""ImageObject",      "url""https://cdn.shopify.com/s/files/1/0716/1731/5114/files/LOGO.png?v=1747982376"    }  },  "wordCount": {{ article.comments_count }},  "keywords": [      "xxx",      "xxxx",      "......"  ]}</script>
记录下下。

【声明】内容源于网络
0
0
Shopify 主题开发
分享独立站的实操经验与教训,也许对您运营 Shopify 有启发。阿飞,专注专研 Shopify 跨境电商方法。
内容 67
粉丝 0
Shopify 主题开发 分享独立站的实操经验与教训,也许对您运营 Shopify 有启发。阿飞,专注专研 Shopify 跨境电商方法。
总阅读6.6k
粉丝0
内容67