Setting up Product Schema Markup for E-Commerce
Product Schema is a markup for product pages that allows Google to display rating stars, price, and availability directly in search results. Increases CTR by 15–30%.
Basic Product Markup
{
"@context": "https://schema.org",
"@type": "Product",
"name": "ASUS ROG Strix G16 Laptop",
"sku": "ROG-G16-2024-RTX4070",
"gtin13": "4711081694342",
"description": "Gaming laptop with RTX 4070, Intel Core i7-13650HX processor and 16-inch 240Hz display.",
"brand": {
"@type": "Brand",
"name": "ASUS"
},
"image": [
"https://example.ru/images/rog-strix-1.jpg",
"https://example.ru/images/rog-strix-2.jpg"
],
"offers": {
"@type": "Offer",
"url": "https://example.ru/notebooks/asus-rog-strix-g16",
"priceCurrency": "RUB",
"price": "149990",
"priceValidUntil": "2024-12-31",
"itemCondition": "https://schema.org/NewCondition",
"availability": "https://schema.org/InStock",
"seller": {
"@type": "Organization",
"name": "TechnoStore"
}
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.7",
"bestRating": "5",
"worstRating": "1",
"reviewCount": "47"
},
"review": [
{
"@type": "Review",
"reviewRating": { "@type": "Rating", "ratingValue": "5" },
"author": { "@type": "Person", "name": "Alexey K." },
"datePublished": "2024-03-10",
"reviewBody": "Excellent gaming laptop, quiet and cool under moderate load."
}
]
}
Product with Variations (ProductGroup)
{
"@context": "https://schema.org",
"@type": "ProductGroup",
"name": "Nike Air Max 90 Sneakers",
"hasVariant": [
{
"@type": "Product",
"name": "Nike Air Max 90 White — size 42",
"offers": { "@type": "Offer", "price": "8990", "availability": "InStock" },
"additionalProperty": [
{ "@type": "PropertyValue", "name": "Color", "value": "White" },
{ "@type": "PropertyValue", "name": "Size", "value": "42" }
]
}
]
}
Dynamic Generation in Laravel
class ProductSchemaGenerator
{
public function generate(Product $product): array
{
return [
'@context' => 'https://schema.org',
'@type' => 'Product',
'name' => $product->name,
'sku' => $product->sku,
'description' => $product->meta_description ?? strip_tags($product->description),
'image' => $product->images->pluck('url')->toArray(),
'brand' => ['@type' => 'Brand', 'name' => $product->brand->name],
'offers' => [
'@type' => 'Offer',
'price' => number_format($product->price / 100, 2, '.', ''),
'priceCurrency' => 'RUB',
'availability' => $product->in_stock
? 'https://schema.org/InStock'
: 'https://schema.org/OutOfStock',
'priceValidUntil' => now()->addMonth()->format('Y-m-d'),
'seller' => ['@type' => 'Organization', 'name' => config('app.name')]
],
'aggregateRating' => $product->reviews_count > 0 ? [
'@type' => 'AggregateRating',
'ratingValue' => number_format($product->average_rating, 1),
'reviewCount' => $product->reviews_count
] : null
];
}
}
Common Mistakes
- Empty fields: Google won't accept schema with
"price": ""or"availability": "" - Data mismatch on page: price in schema must match visible price
-
reviewCount: 0with no reviews — removeaggregateRatingentirely - Wrong price format: numbers only without currency symbol (
"8990", not"8990 ₽")
Setup timeline: 1 business day for dynamic generation on all product pages.







