Skip to main content
All CollectionsIntegrating our serviceSet up
Shopper Approved Product Review Integration Overview
Shopper Approved Product Review Integration Overview

Here is a detailed step-by-step overview for integration of Product reviews.

Updated over 6 months ago

Step 1 - Provide us with your product feed

To get started, we will need to collect your current product feed and map that to our system. This step is required in order to collect product reviews. Our system needs to know what products you sell along with their strong identifiers so we can pass that information off to Google.

If you have a Google shopping feed, it’s best to send that over as well for review since we want to make sure your product feed matches exactly with what Google has.

Here are the strong identifiers for a product feed:

  • Product ID

  • Product name

  • Product URL

  • Product Image URL

  • Brand

  • Manufacturing Parts Number (MPN)

  • Global Trade Identification Number (GTIN)

  • Parent ID (item_group_id) This is used to aggregate the reviews of the variations of a product so each review will aggregate on the parent level.

Note: If you don’t have a GTIN, then we MUST have a Brand AND MPN in order to show stars in your product listing ads. If you have all of these strong identifiers, it’s best to include them.

If your products are custom made and you don’t have an MPN or GTIN, you can use the product id as the MPN.

Why do we need all this information?

  1. In order for us to ask your customers for a product review, we need to know what products they purchased. We will ask your customers to review the exact product they purchased which includes the product name and image. Furthermore, when the customer leaves a review, we associate that review to the specific product.

  2. Secondly, we store the product reviews we collect on your behalf in our system and pass them to Google for syndication. In order for your review to count in Google and in your product listing ads, Google needs to know exactly what product it is and what domain it comes from. By giving us these strong identifiers, it helps Google to identify which products the reviews go to and match them to your Google shopping feed and product listing ads.

If you want to collect product reviews on all the products you sell, we will need a feed with all products. If you want to collect product reviews on only the products you have product listing ads on, the feed can be more limited.

Once you are ready to give us your product feed, you can log in to Shopper Approved and provide your product feed in one of two ways:

  1. One time feed upload: If you upload a CSV file, the file will be mapped one time. Any future products will not be included unless you upload a new file including those products.

  2. Dynamic feed (recommended): If you have a hosted URL you can provide, you can set up a scheduled export of your products. Our system will read your feed on a weekly basis and any changes you make to your feed will be automatically updated. Acceptable file types are CSV and XML.

Here is an example file for you to reference. To submit your product feed to our system, navigate to the main menu in the upper left hand corner > Setup > Product Integration.

Note: It’s always best to have one of our support members review your product feed the first time to ensure it includes everything we need.

Once you have either uploaded the one time feed or provided a dynamic URL, we will map your product feed to our system. This step must happen before you can start collecting product reviews.

Step 2 - Add the product bolt-on code to your order confirmation page

To transfer information about a customer's purchases to our system, you will need to add the product bolt-on code. This code is designed to populate product details into the "sa_products" object on your order confirmation page. You can find the code example on the "Setup > Product Integration" page.

<script> var sa_products = { 'productid1':'Product Name 1', 'productid2':'Product Name 2', 'productid3':'Product Name 3' }; </script>

The best way to accomplish this would be to use a loop to go through the products that were purchased and then populate the key-value pairs of product id and product name into sa_products. Please see below for an example.

<script>

var sa_products = {};

for (i = 0; i < products.length; i++) {

sa_products[products[i].id]=products[i].name;

}

</script>

Best Practices

  • Pass the CHILD variant ID. Passing the parent ID can cause reviews to attach incorrectly which may cause syndication issues in most circumstances and could break Shopper Approved's ability to syndicate or display your product reviews. Do NOT pass the parent ID. If you need to, please contact [email protected]

  • Always escape Product Names. Failure to do so will break the script resulting in no feedback collection.

  • Make sure the variable will be ready and populated with data when the survey script loads. If the data is not present, a product review cannot be requested in the follow-up review request.

Step 3 - Place a Test Order

Once you have added the code snippet to your order confirmation page with the correct values, you will want to place a test order to ensure the survey submission passes the correct product values onto the review.

After checking out, you should see a survey on your order confirmation page.

If you are passing the order id, name and email, the name and email should be auto-filled in the fields.

Fill out the survey as if you were a customer and submit the review.

To verify the review came through with the correct values, log in to your Shopper Approved account to see your review under the main navigation > Seller Ratings > Manage Seller Ratings.

You should see a review similar to this with the values and the product attached.

If you do not see a product attached (marked in red in the example above) then the product data may not be passing correctly or may not be matching up with your product feed.

Please note that if your review is not marked as “test”, you should reach out to [email protected] to prevent any issues with your account.

To test the follow-up email, you can set the follow-up days to 0 days before submitting the checkout (initial) review. This will send a follow-up email within a few hours to the email address from the survey. From that email, you can fill out the post-fulfillment (full) survey as well.

Note: After placing a successful test order, you will want to change the follow-up days to the average days to delivery. Keep in mind these are calendar days.

Step 4 - Add product ratings to collection pages

Once you start collecting product reviews, you will want to display the star ratings and review count on your site. One location where you can display the product ratings is underneath the product on a collections page on a per product level.

You will add code to the collection page once and then add divs to each category listing so the star rating and review count appear below each product. You can find this code under Setup > Category Code. The code below will be loaded on the page one time.

Please note the default behavior is that if no reviews are found no star containers will be shown. If you would like empty stars to show please reach out to support at [email protected].

<script type="text/javascript"> function saLoadScript(src) { var js = window.document.createElement('script'); js.src = src; js.type = 'text/javascript'; document.getElementsByTagName("head")[0].appendChild(js); } saLoadScript("https://www.shopperapproved.com/widgets/group2.0/xxxxx.js"); </script>

You will then place the code below on each category listing replacing product_id_here with the product ID for the respective product.

Note: This script should not be included on checkout pages including the order confirmation page.

<div class="star_container product_id_here"></div>

Once you place the code, the category pages should display the star rating and review count.

Step 5 - Add Product Star Rating and Review Count Code to Product pages

You can find this code snippet under Setup > Product Page Code under Step 1 - Copy Your Star Code. This code is only for one product on a product page.

You will configure your product stars and widgets and then copy and place the code.

You can select either small or big stars. Here is an example code snippet:

<div id="product_just_stars" class="reg aside"></div>

Step 6 - Customize your product page widget

Under Setup > Product Page Code > Customize your product page widget, you can customize your display, sort and schema settings. You will want to select how many product reviews you’d like to collect before displaying the product reviews. We will display Seller Reviews until reaching the threshold of Product Reviews you select in these settings.

Schema Setting

Note the setting, "Inject JSON-LD schema”.

If the schema on your site is currently in JSON-LD format and you have an @id attribute that contains the product URL, enable this setting to have the product review widget automatically inject the Aggregate Rating schema onto your product pages.

Note: Turning this feature on will enable your product reviews to be crawled by Google so your ratings will show up in organic searches. Prior to turning this feature on, all non json_ld schema on your product pages should be removed.

If you are not sure about your existing schema or have any other questions related to schema, please reach out to [email protected] and our dedicated support team can advise you on what needs to be done to benefit from this schema.

Step 7 - Add Product Review Code

Now that you have your settings configured and your product review widget is customized, copy and paste the code snippet and paste it to the desired location of your website.

Here is an example code snippet. Please make sure to copy the code snippet within your dashboard.

<div id="SA_review_wrapper"></div><script type="text/javascript">var sa_product = '[PRODUCT ID]'; var sa_interval = 5000;function saLoadScript(src) { var js = window.document.createElement('script'); js.src = src; js.type = 'text/javascript'; document.getElementsByTagName("head")[0].appendChild(js); } if (typeof(shopper_first) == 'undefined') saLoadScript('//www.shopperapproved.com/widgets/xxxxx/product/'+sa_product+'/product-widget/yyyyyyyyyyy.js'); </script>

Note: You will have to replace the [PRODUCT ID] placeholder anywhere you place this code. Also, some carts will strip div tags with empty content. If this is the case put a &nbsp in the empty divs to keep it from doing so.

Once your code is placed, and if you have collected product reviews, you should see the product reviews widget on the product page.

You’re all set! If you have any questions about your integration, please reach out to [email protected].

Happy Collecting!

Did this answer your question?