Picture of Shubham Vijay

Shubham Vijay

Top Rated Upwork Developer

I’m a freelance Wordpress developer and web designer based in India. I started freelancing in 2012 and have worked for a wide range of personal clients and agencies. I design and build WordPress websites. My goal is to do great work, for great people and organisations.

How to Add Dynamic Schema Markup to Shopify Store?

Facebook
Twitter
LinkedIn
The Schema is a code or form of structured data that can use to markup several types of web content. Structured data or schema markup provides clear and more information to search engines about your E-commerce store or website and its content.
In the context of Shopify, e-commerce, schema markup tags can provide valuable data about your products. This rich result (rich snippet) displays more information than standard search results.
In addition, this data helps search engines to read and understand your site better. For example, while typical results display only a page’s title, URL, and meta description.

Product Schema

				
					
{% if template.name == 'product' %}

<script type="application/ld+json">
    {
      "@context": "https://schema.org/",
      "@type": "Product",
      "name": "{{ product.title }}",
       {%- if product.featured_media -%}
    {%- assign media_size = product.featured_media.preview_image.width | append: 'x' -%}
    "image": [
      {{ product.featured_media | img_url: media_size | prepend: "https:" | json }}
    ],
  {%- endif -%}
      "description": {{ product.description | strip_html | json }},
      "sku": "{{ current_variant.sku }}",
      "mpn": "{{ current_variant.barcode }}",
      "brand": {
        "@type": "Brand",
        "name": "District A Design"
      },
      "review": {
        "@type": "Review",
        "reviewRating": {
          "@type": "Rating",
          "ratingValue": "5",
          "bestRating": "5"
        },
        "author": {
          "@type": "Person",
          "name": "Example site"
        }
      },
      "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "5",
        "reviewCount": "5"
      },
      "offers": {
        "@type": "Offer",
        "url" : {{ shop.url | append: variant.url | json }},
        "priceCurrency" : {{ cart.currency.iso_code | json }},
        "price" : {{ current_variant.price | divided_by: 100.00 | json }},
        "priceValidUntil": "{{ 'now' | date: '%s' | plus: 31536000 | date: '%Y-%m-%d' | uri_encode | replace:'+','%20' }}",
        "itemCondition": "https://schema.org/NewCondition",
        "availability" : "http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}"
      }
    }
    </script>


{% endif %}
				
			

BreadcrumbList Schema

				
					
<script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "BreadcrumbList",
      "itemListElement": [{
        "@type": "ListItem",
        "position": 1,
        "name": "Home",
        "item": "https://Examplesite.com/"
      },{
        "@type": "ListItem",
        "position": 2,
        "name": "{{ product.title }}",
        "item": "{{ shop.url }}{{ product.url }}"
      }]
    }
    </script>
				
			
0/5 (0 Reviews)

More to explorer

Ask me if you have any question ?

Leave a Comment

Your email address will not be published. Required fields are marked *