Unsupported or Custom Platform: Getting Started

  • Updated

If you're running on a custom-built or e-commerce platform other than those listed below, use this guide to learn how to install the Stamped main widget, add Product Rich Snippets, and push your order data into Stamped.


In this guide


Adding the main widget

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 find 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 tools, such as GSDT, to confirm that the placement of the code is correct. You should see the aggregateRating field rendering within the product schema on product pages, which contains reviews:

US1.png


Pushing Orders Into Stamped

We'll need to know when a new order has been created or fulfilled so that Stamped can send the customer a review request email. This can be done by pushing order data into Stamped:

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.

 

Related to

Was this article helpful?

3 out of 13 found this helpful

Have more questions? Submit a request