After successfully registering Google Customer Reviews on Google Merchant Center (GMC), the final step to collect reviews from your customers is to integrate the Survey opt-in module into your store. This article will show you how to integrate the survey opt-in module into your ShopBase store.
In this article
A. What is Google Customer Reviews?
B. Integrate Google Customer Reviews survey opt-in module on your store
A. What is Google Customer Reviews?
Google Customer Reviews is a service by Google Merchant Center that allows you to collect valuable feedback from customers who’ve made a purchase on your site. By integrating Google Customer Reviews on your ShopBase store, you can collect reviews and use these reviews to display on your store or marketing platforms.

B. Integrate Google Customer Reviews survey opt-in module on your store
You need to Enable Google Customer Reviews in your Google Merchant Center account. Please visit this article to learn more about this step.


<script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer>
</script>
<script>
window.sbsdk.ready(function() {
window.sbsdk.page.onContextUpdate(function(context) {
if (context.type === 'post_checkout') {
// Inject code tracking here
var estimated_delivery_date = new Date()
estimated_delivery_date.setDate(estimated_delivery_date.getDate() + 14);
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
window.gapi.surveyoptin.render({
// REQUIRED
"merchant_id": "754845486",
"order_id": window.sbsdk.checkout.getOrder().id,
"email": window.sbsdk.checkout.getOrder().email,
"delivery_country": window.sbsdk.checkout.getOrder().shipping_address.country_code,
"estimated_delivery_date": estimated_delivery_date.toISOString().split("T")[0],
});
});
}
window.renderOptIn();
}
});
});
</script>
"MERCHANT_ID"
needs to be changed to the merchant ID of your GMC account.For example, if your merchant ID is 123456789, then the code should be changed to: "merchant_id": 123456789,

How to modify the code to change the email review time
By default, the above code of ShopBase will allow you to send product review emails to your customers after 14 days since the order creation date. You can customize this time period to match your store's policy as follows:
14
in the above code with any other natural number. The number to be replaced is the number of days that will be counted from the time the order is created.For example, if the Estimated Delivery Date of your store is 7, then the code needs to be changed to: estimated_delivery_date.setDate(date.getDate() + 7);
C. Verify the results
After completing all the steps in section B to integrate the Survey opt-in module into your store, you can check if everything is working properly by following the instructions below:
14
in the estimated_delivery_date.setDate(date.getDate() + 14);
code line with 0
to change the Estimated Delivery Date to 0.


The system can now automatically send review invitations to customers after they complete a purchase.
Additional scripts added to the store will NOT load on the checkout page for security reasons and to prevent payment interference. Use ShopBase’s built-in tracking and integrations instead.