为什么Shopify店铺需要结构化数据?
结构化数据带来的直接收益
- 富媒体片段展示 - 产品图片、价格、评分直接显示在搜索结果中
- 提高点击率 - 比普通搜索结果高出30-40%的点击率
- 增强信任度 - 显示评分和价格让顾客更有信心
- 移动搜索优化 - 在手机搜索中获得更好的展示效果
Shopify店铺必须实现的4种结构化数据
1. 产品结构化数据(Product Schema)
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Product", "name": "{{ product.title }}", "description": "{{ product.description | strip_html | truncate: 160 }}", "image": "{{ product.featured_image | img_url: 'master' }}", "brand": { "@type": "Brand", "name": "{{ shop.name }}" }, "offers": { "@type": "Offer", "price": "{{ product.price | money_without_currency }}", "priceCurrency": "{{ shop.currency }}", "availability": "{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}" } } </script>
- 确保产品图片质量高且尺寸合适
- 描述要简洁明了,突出产品特色
- 实时反映库存状态
2. 评价结构化数据(Review Schema)
{% if product.metafields.reviews.rating %} <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Product", "name": "{{ product.title }}", "aggregateRating": { "@type": "AggregateRating", "ratingValue": "{{ product.metafields.reviews.rating }}", "reviewCount": "{{ product.metafields.reviews.count }}" } } </script> {% endif %}
3. 面包屑导航(BreadcrumbList Schema)
<scripttype="application/ld+json"> { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "name": "首页", "item": "{{shop.url}}" }, { "@type": "ListItem", "position": 2, "name": "{{collection.title}}", "item": "{{collection.url| prepend: shop.url}}" } ] } </script>
4. 组织信息(Organization Schema)
<scripttype="application/ld+json"> { "@context": "https://schema.org", "@type": "Organization", "name": "{{shop.name}}", "url": "{{shop.url}}", "logo": "{{'logo.png'| asset_url }}", "sameAs": [ "https://www.facebook.com/yourpage", "https://www.instagram.com/yourpage" ] } </script>
Shopify主题文件集成位置
产品页面 (product.liquid)
在 </head> 标签前添加产品结构化数据
首页 (index.liquid)
集合页面(collection.liquid)
文章页面(article.liquid)
Shopify特有的优化技巧
1.利用Metafields扩展数据
<!-- 添加产品特有属性 --> {% if product.metafields.custom.brand %} "brand": { "@type": "Brand", "name": "{{ product.metafields.custom.brand }}" } {% endif %}
2. 多变体产品处理
"offers": [ {% for variant in product.variants %} { "@type": "Offer", "price": "{{ variant.price | money_without_currency }}", "priceCurrency": "{{ shop.currency }}", "sku": "{{ variant.sku }}", "availability": "{% if variant.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}" }{% unless forloop.last %},{% endunless %} {% endfor %} ]
常见问题
评论0