E-commerce 15.04.2026 conversion, ecommerce, google

Google Reviews Opt-in in PrestaShop 9

Step-by-step guide for adding Google Customer Reviews opt-in on the order confirmation page in PrestaShop 9 using HTML Box Pro and dynamic order variables.

How to Integrate Google Customer Reviews in PrestaShop 9 with HTML Box Pro

Customer reviews are one of the strongest conversion drivers in e-commerce. Google Customer Reviews helps you collect trusted post-purchase feedback that can support your brand visibility in Google services.

In this guide, you will learn how to implement the official Google Customer Reviews opt-in script on the Order Confirmation page in PrestaShop 9 using HTML Box Pro and order shortcodes.

The real game changer is the module's dynamic variable engine: it automatically injects live order data into each shortcode used in your script. This is where HTML Box Pro truly shines, giving you exceptional flexibility, enterprise-level precision, and the power to launch advanced, personalized integrations in minutes without writing custom backend logic. WOW-level efficiency for real-world e-commerce workflows.

What You Need Before You Start

Google Merchant Center Access

A configured Google Merchant Center account with Google Customer Reviews enabled, plus your numeric Merchant ID.

PrestaShop and Module Setup

A running PrestaShop 9 store and HTML Box Pro with order shortcode support. The latest module release is recommended, but version 4.0.3 is sufficient for this implementation.

Step 1: Create a New HTML Box Pro Block

Open your PrestaShop back office and go to the HTML Box Pro configuration screen.

  • Create a new block.
  • Set the hook to displayOrderConfirmation .
  • Set Active to ON .
  • In Visibility for (users' groups) , select the customer groups that should see the GCR opt-in popup. If you want to show it to everyone, select all groups .
  • This ensures the opt-in appears only after a successful order and only for your selected audience.

Important Visibility and Activation Check

If the block is not active or group visibility is limited to the wrong audience, customers will never see the opt-in window. Before testing, always verify Active = ON and confirm your group selection.

Step 2: Paste the Google Customer Reviews Script

Paste the code in HTML mode (not as a Smarty template). Replace the Merchant ID with your own value.

Editor Warning

Before pasting the script, enable the extended editor in the module general settings. The standard PrestaShop editor can remove or inject unwanted HTML tags, which may deform the code and break the integration.

Important Warning

You must change merchant_id to your real Google Merchant Center ID. Do not leave the example value in production, otherwise Google Customer Reviews opt-in will not work correctly for your store.

<!-- BEGIN GCR Language Code -->
<script>
window.___gcfg = {
  lang: '{id_lang}'
};
</script>
<!-- END GCR Language Code -->

<!-- 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": 123456789,
      "order_id": "{order_id}",
      "email": "{order_customer_email}",
      "delivery_country": "{order_delivery_country}",
      "estimated_delivery_date": "{order_delivery_date}"
    });
  });
}
</script>
<!-- END GCR Opt-in Module Code -->

Step 3: Understand the Variables

Language Code

{id_lang}

Uses the customer language ISO code, so the opt-in displays in the proper language context.

Order ID

{order_id}

Inserts the exact ID of the order placed by the customer.

Customer Email

{order_customer_email}

Passes the buyer email where Google can send the survey request.

Delivery Country and Date

{order_delivery_country}, {order_delivery_date}

Provides shipment destination and estimated delivery date in the expected format.

Step 4: Save and Test

Functional Check

Save the block and place a test order. On the confirmation page, verify that the opt-in popup appears correctly.

The popup language should match the current order language.

Source Validation

Open browser developer tools and inspect the generated source to confirm that placeholders are replaced with real order values.

If values are rendered correctly, the integration is ready.

Recommended Solution

Google Customer Reviews: Opt-in & Seller Ratings

Skip the manual code editing! This module seamlessly integrates the GCR opt-in on your order confirmation page. It automatically handles GTINs, EAN-13, and delivery dates to ensure your surveys are sent at the perfect time.

  • No manual snippet pasting or file editing required
  • Smart delivery date calculation for survey timing
Get the Module Fully compatible with PrestaShop 1.7 & 8.x & 9.x
Zdjęcie autora: Milosz Myszczuk

Article written byMilosz Myszczuk, PrestaShop expert. CEO and founder of the VEKIA interactive agency. Learn more.

If you like this article, support our work!

Comments