Discussions
How to add Google Customer Reviews "opt-in" script in SCA site
We got the below script for adding Google Customer Reviews to our website. It needs to added to order confirmation page.
But there are two options in SCA:
1. order_wizard_confirmation_module.tpl in order confirmation module
2. SCA Web Set Up - Analytics sub tab - Order Confirmation Page
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>
<script>
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
window.gapi.surveyoptin.render(
{
// REQUIRED FIELDS
"merchant_id": ID,
"order_id": "<%=getCurrentAttribute('confirmation','ordernumber')%>",
"email": "<%=getCurrentAttribute('customer','email')%>",
"delivery_country": "<%=getCurrentAttribute('confirmation','shiptocountry')%>",
"estimated_delivery_date": "YY-MM-DD"
});
});
}
</script>