Please Note: Reviews and seller ratings do not show on your website until Google's criteria is met. Learn more about the critera
here.
Integrating the Google survey opt-in module into your webstore is easy to install using a custom script.
Important: Ensure you have added estimated delivery times for each zone in your
shipping rates tables. Google will send the survey after the estimated days, so it must be accurate.
-
In your Maropost Commerce control panel navigate to Settings & Tools > All settings & tools.
-
Click on Analytics & 3rd Party Scripts tab and click Custom Scripts.
-
Click the Add New button.
-
Name the script Google opt-in survey.
-
Enter your Google merchant ID into the Referral Key 1 field, and enter the average number of days it takes for your customers to received their goods in the Referral Key 2 field.
-
Scroll down to the Scripts section and click on the Purchase Confirmation (Thank You Page) tab.

-
Copy the following script into your control panel:
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn"
async defer>
</script>
<script>
var productGTINs = [];
[%show_order id:'[@order_id@]'%]
[%param *body%]
productGTINs.push('{"gtin":"[@barcode@]"}');
[%/param%]
[%param *footer%]
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
window.gapi.surveyoptin.render(
{
// REQUIRED
"merchant_id": "[@REFERRAL_KEY1@]",
"order_id": "[@order_id@]",
"email": "[@email@]",
"delivery_country": "[@bill_country@]",
"estimated_delivery_date":"[%format type:'date' format:'#Y-#M-#D' add:'[@REFERRAL_KEY2@] day'%]now[%/format%]",
// OPTIONAL
"opt_in_style": "OPT_IN_STYLE",
"products": productGTINs
});
});
};
window.___gcfg = {
lang: 'en_AU'
};
[%/param%]
[%/show_order%]
</script>
- Click Save Changes. The opt-in survey will now appear once an order is complete on the Thank You page.
You can also add a widget into the footer of your website that displays your Google customer reviews.
-
Open the Google opt-in survey custom script, and select the Footer tab.
-
Paste the below code into the footer tab.
[%IF [@block_scripts@]%]
<!-- Google Customer Reviews has been blocked -->
[%ELSE%] <!-- Google Customer Reviews -->
<script src="https://apis.google.com/js/platform.js?onload=renderBadge" async defer></script>
<script>
window.renderBadge = function() {
var ratingBadgeContainer = document.createElement("div"); document.body.appendChild(ratingBadgeContainer); window.gapi.load('ratingbadge', function() {
window.gapi.ratingbadge.render(ratingBadgeContainer, {
"merchant_id": [@REFERRAL_KEY1@]
} );
});
}
</script>
[%/IF%]
-
Save your changes.
Please Note: Changes to a custom script require you to authenticate your access. Click the Send Token Now button and an email will be sent to you with a security token. Copy the token and paste it into the verification field. Click the Verify Token button and your changes can be saved. The token will last two hours in case you need to change multiple scripts.