Due to Shopify's architecture, PowerReviews' Out-of-the-Box SEO (Option 1) solution is our standard and only supported method for clients using Shopify as their eCommerce platform.
Important Note: If you are currently using a third-party plugin for SEO or custom schema markup, the instructions below may require careful review or not directly apply. We highly recommend consulting with your PowerReviews Customer Success Manager or Implementation Team for tailored guidance.
Adding the Subject Object Code
To enable PowerReviews to generate accurate JSON+LD markup for SEO, your product information must be passed to us in a specific format. This code is in addition to any Product Data code we are already receiving for Feedless.
This complete code block should typically be placed within your Shopify Product Detail Page (PDP) Liquid template, often found in files like product-template.liquid or main-product.liquid.
The following is an example of a complete code block within a Shopify PDP, including the code necessary for SEO:
<!-- start_review_render_code_js_section --> <script> window.pwr = window.pwr || function () { (pwr.q = pwr.q || []).push(arguments); }; pwr("render", { api_key:'<YOUR_API_KEY>', // Provided by PowerReviews locale: '<YOUR_LOCALE>', // Provided by PowerReviews merchant_group_id: '<YOUR_MERCHANT_GROUP_ID>', // Provided by PowerReviews merchant_id: '<YOUR_MERCHANT_ID>', // Provided by PowerReviews page_id: "{{ product.id }}", // The unique ID for the product review_wrapper_url: "https://<STORE>.myshopify.com/pages/write-a-review/?pr_page_id={{ product.id }}", // Your wrapper URL product: { name: "{{ product.title | escape | replace: "+", " " }}", url: "https://powerreviews-seo.myshopify.com{{ product.url }}", image_url: "https:{{ product.featured_media.preview_image | img_url: "large" }}", // Corrected from product.featured_image description: "{{ product.description | strip_html | strip_newlines | replace: "%0A", "%20" | replace: '"', '%27' | escape }}", category_name: {% if product.type != '' %}"{{ product.type }}"{% else %}"Default"{% endif %}, upc: "{{ product.barcode }}", brand_name: "{{ product.vendor }}", price: "{{ product.price | money_without_currency }}", in_stock: "{{ product.available }}", variants: [ {% for variant in product.variants %} {% assign product_name = product.title %} {% if product.variants.size 1 %}{% assign product_name = variant.title %}{% endif %} // Corrected from `size 1` to `size 1` { name: "{{ product.title | escape | replace: "+", " " }}", description: "{{ product_name | escape }}", page_id_variant: "{{variant.id}}", upc: "{{ variant.barcode }}" }{% if forloop.last == false %}, {% endif %} {% endfor %} ] }, // IMPORTANT: The 'subject' object below passes crucial structured data for SEO. // This data works in conjunction with, and does NOT replace, any existing Feedless data. subject: { "@context": "https://schema.org", "@type": "Product", name: "{{ product.title | replace: "+", " " }}", description: "{{ product.description | strip_html | strip_newlines | replace: "%0A", "%20" | replace: '"', '%27' | escape }}", offers: { "@type": "Offer", priceCurrency: "USD", price: "{{ product.price | money_without_currency }}", availability: "https://schema.org/InStock" } }, components: { ReviewSnippet: "pr-reviewsnippet", ReviewImageSnippet: "pr-imagesnippet", ReviewDisplay: "pr-reviewdisplay" } }); </script> <!-- end_review_render_code_js_section -->
Removing Non-PowerReviews Product Schemas
Product schemas can be generated in different locations depending on your Shopify template(s), and the code itself may contain variations. For this reason we are not able to provide a specific location where you can find this, but below is some guidance to help you find this within the code of your page. Your actual code may vary from the examples, but should contain certain key elements.
JSON+LD
Outside of the PowerReviews code, look for an @context containing "schema.org" and an @type with the value "Product." The entire script section will need to be removed or commented out.
Example JSON+LD Product Schema:
<script type="application/ld+json"> { "@context": "http://schema.org/", "@type": "Product", "name": {{ product.title | json }}, "url": {{ shop.url | append: product.url | json }}, {%- if product.featured_media -%} {%- assign media_size = product.featured_media.preview_image.width | append: 'x' -%} "image": [ "{{ product.featured_media.preview_image | img_url: media_size | prepend: "https:" }}" ], {%- endif -%} "description": {{ product.description | strip_html | json }}, {%- if current_variant.sku != blank -%} "sku": {{ current_variant.sku | json }}, {%- endif -%} "brand": { "@type": "Thing", "name": {{ product.vendor | json }} }, "offers": [ {%- for variant in product.variants -%} { "@type" : "Offer", {%- if variant.sku != blank -%} "sku": {{ variant.sku | json }}, {%- endif -%} "availability" : "http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}", "price" : {{ variant.price | divided_by: 100.00 | json }}, "priceCurrency" : {{ cart.currency.iso_code | json }}, "url" : {{ shop.url | append: variant.url | json }} }{% unless forloop.last %},{% endunless %} {%- endfor -%} ] } </script>
Microdata
Some Shopify sites (typically older ones) will use the Microdata format for product schema instead of JSON+LD. With this, you will search for "schema.org/Product" within an itemtype property. The itemtype and itemscope properties should be removed or commented out so that there is just div with a class name. Without the product schema being declared, any metatags associated with the product schema should be ignored. Ideally, we would want to remove the metatags as well if they exist, but leaving them there should not impact the product schema.
Example Microdata Product Schema:
<div class="grid" itemscope itemtype="http://schema.org/Product"> <!-- Content of the product goes here --> </div>