This guide is intended for those running on a custom-built platform, or an e-commerce platform other than:
In this guide
Adding Review Widget to your store
This is where the reviews submitted by your customers will be shown, and customers will also be able to share reviews directly in the widget. Installation of this widget is simple and just requires a script and HTML element to be added.
Add in Header:
<script type="text/javascript" src="https://cdn1.stamped.io/files/widget.min.js"></script> <script type="text/javascript">//<![CDATA[ StampedFn.init({ apiKey: '##publicAPIKey##', sId: '##storeHash##' }); // ]]></script>
Add in Product Page for Main Review Widget:
<div id="stamped-main-widget" data-product-id="##product.id##" data-name="##product.title##" data-url="##product.url##" data-image-url="##product.image##" data-description="##product.description##" data-product-sku="##product.handle##"> </div>
Add in Product / Collection page for Reviews Star Badge:
<span class="stamped-product-reviews-badge stamped-main-badge" data-id="##product.id##"></span>
Note: Replace all variables with your store's and product's info. ##sId## should be the storeHash which you can get in the API Keys section in the dashboard
https://go.stamped.io/v3/#/settings/api
Including Product Rich Snippet
To include the product rich snippet, your store needs to have a set of product schema codes present in the site, which can be custom-developed or rendered by an SEO app. Once the product schema is present, please install the following script:
<script> function addEventListenerStamped(el, eventName, handler) { if (el.addEventListener) { el.addEventListener(eventName, handler); } else { el.attachEvent('on' + eventName, function () { handler.call(el); }); } } addEventListenerStamped(document, 'stamped:reviews:loaded', function(e) { var ratingCount = jQueryStamped('meta[itemprop="reviewCount"]').attr('content'); var ratingValue = jQueryStamped('meta[itemprop="ratingValue"]').attr('content'); var richSnippet = { "@context": "http://schema.org", "@type": "Product", "@id": "HTTPS://STORE.COM/URL/#product" } if (parseInt(ratingValue) > 0){ richSnippet.aggregateRating = { "@type": "AggregateRating", "ratingValue": ratingValue, "reviewCount": ratingCount } } var script = document.createElement('script'); script.type = 'application/ld+json'; script.innerHTML = JSON.stringify(richSnippet); document.getElementsByTagName('head')[0].appendChild(script); }); </script>
You will then need to include the same "@id" field in the product schema code present within the site, to link the two pieces together:
"@id": "HTTPS://STORE.COM/URL/#product"
You can make use of Google's tool, such as GSDT to confirm the placement of the code is correct. You should see the aggregateRating field rendering within the product schema on product pages which contains reviews:
Pushing Orders Into Stamped
We'll need to know when a new order has been created or fulfilled, so that Stamped can create a review request email to be sent to the customer. This can be done by pushing order data into Stamped. There are two options:
- Integration with our API (Stamped REST APIs) *Available on Business & Professional plans
We provide public API endpoints. On an order update/fulfillment event/action, you'll push the order data into the Stamped API and a review request email will be created for the order.
OR - Import order details via excel file (Sample excel file) *Available on all paid plans
Alternatively, if API integration is difficult with your platform or you do not have a developer/agency, you can create review requests for the orders by importing a formatted excel file with the order data. This can be done periodically (e.g., daily or end of the week).