Google Product Reviews with WordPress + WooCommerce

Does anyone know how to integrate the new Google Product Reviews with WooCommerce?

Google provide instructions that are below but not sure how this would worth with Woo.

If anyone can point me in the right direction, it would be very much appreciated!!

Add the opt-in code

To give your customers the option of submitting a review of their experience buying from you, add the opt-in module to your order confirmation page.

To add the survey opt-in module to your order confirmation page:

Paste the following HTML snippet into your order confirmation page:


<!-- 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": MERCHANT_ID,
          "order_id": "ORDER_ID",
          "email": "CUSTOMER_EMAIL",
          "delivery_country": "COUNTRY_CODE",
          "estimated_delivery_date": "YYYY-MM-DD",

          // OPTIONAL
          "opt_in_style": "OPT_IN_STYLE"
        }); 
     });
  }
</script>
<!-- END GCR Opt-in Module Code -->

Place the code just before the closing </BODY> tag. When you place the survey module code with the badge code, the order does not matter: the survey module code can be before or after the badge code.

Read more here: Google Product Reviews with WordPress + WooCommerce

Leave a Reply

Your email address will not be published. Required fields are marked *