Confirmation Page
<!DOCTYPE html>
<!-- BEGIN GCR Opt-in Module Code -->
<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
"merchant_id": "
344359983
",
"order_id": "
<?php echo $order_id ?>
",
"email": "
<?php echo $email_address ?>
",
"delivery_country": "
<?php echo $user_country ?>
",
"estimated_delivery_date": "
?php echo $delivery_date ?
",
// OPTIONAL
"products":
[{"gtin":"<?php echo $gtin_1 ?>"}, {"gtin":"<?php echo $gtin_2 ?>"}],
"opt_in_style": "BOTTOM_LEFT_DIALOG"
});
});
}
</script>
<!-- END GCR Opt-in Module Code -->
<!-- BEGIN GCR Language Code -->
<script>
window.___gcfg = {
lang: 'en_US'
};
</script>
<!-- END GCR Language Code -->
<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": 344359983}); }); } </script>
PASTE THIS BELOW INTO SETTINGS-CHECKOUT-ADDITIONAL SCRIPTS:
{% if first_time_accessed %}
<!-- BEGIN Google Customer Reviews -->
<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(
{
"merchant_id": 344359983,
"order_id": "{{ order.name }}",
"email": "{{ order.email }}",
"delivery_country": "{{ shipping_address.country_code }}",
"estimated_delivery_date": "{{ order.created_at | date:'%s' | plus:604800 | date:'%F' }}"
});
});
}
window.___gcfg = {
lang: '{{ shop_locale.iso_code }}'
};
</script>
<!-- END Google Customer Reviews -->
{% endif %}