Local business

How do I add the Google Customer Reviews survey opt-in to my order confirmation page?

Expert answer

Google’s help says the survey opt-in module is required on all order confirmation pages to take part. Make the first line , put the opt-in code just before the closing BODY tag on desktop and mobile, and replace five variables with real values: merchant ID, order ID, customer email, country code and estimated delivery date.

Source: Google Merchant Center Help: Google Customer Reviews survey opt-in, per the help page as of 22.11.2026

What Merchant Center’s help says

  • The module is required on all order confirmation pages to participate. Opted in customers get a survey after the estimated delivery date. Add it to desktop and mobile.
  • Step 1: the page must start with as the first line, with no comments or whitespace before it.
  • Step 2: place the opt-in code just before the closing BODY tag. Its order relative to the badge code does not matter.
  • Required variables: MERCHANT_ID (your Merchant Center ID); ORDER_ID (unique); CUSTOMER_EMAIL (name@domain.com); COUNTRY_CODE (2 letter ISO 3166-1 alpha-2, not ZZ); ESTIMATED_DELIVERY_DATE (YYYY-MM-DD).
  • Optional: OPT_IN_STYLE for the dialog position (default CENTER_DIALOG) and a language setting in window.___gcfg; without it the browser language decides.
  • Site rules: HTTPS confirmation pages; a third party checkout must send customers back to a confirmation page on your domain; do not cover the module; order details must be accurate.
  • The page does not say what happens if a value is wrong, the format of ORDER_ID, where OPT_IN_STYLE goes in the template, whether the language snippet is needed, the exact survey time, how opt outs are handled or how to troubleshoot; its code samples have small inconsistencies. Checked 23.11.2026.

In our experience

We do it like this: we test the confirmation page with a real order and look at the page source for the code.

We fill the variables from the order data and never type fixed values.

What is your situation?

The page has a comment before DOCTYPE. The page says nothing may come before it.
A third party checkout. It must redirect back to a confirmation page on your domain.
A placeholder left in the code. Replace all five variables with real values.

Steps

  1. Check that the first line is .
  2. Copy the opt-in code from the page.
  3. Place it just before the closing BODY tag.
  4. Replace the five variables with dynamic values.
  5. Place a test order and check the page source.

How to know it worked

  • The code is on the confirmation page and the variables are filled.
  • The page uses HTTPS.

Different result? For product reviews sent as a file, see the page on submitting product reviews. For checkout rules, see the page on checkout requirements.

Other ways people ask this

Google Customer Reviews opt-in order confirmation page. Google Customer Reviews code merchant_id order_id. Customer reviews survey Merchant Center. OPT_IN_STYLE CENTER_DIALOG. Estimated delivery date Google Customer Reviews.

Download the free checklist

Use the weekly and monthly Google Business Profile checklist to keep your details, posts, reviews and photos up to date.

Get the free checklist

Need help?

Send the link to your profile, your email and your type of business (optional). We reply within 3 days.
Example of the answer you get: "You know the two steps and the five variables."

Knowledge base: review request

How we handle your details: Privacy policy.

  • How do I submit product reviews to Google: upload a file or use a reviews aggregator?
  • What checkout requirements must my online store meet for Merchant Center?
  • How do I verify and claim my online store URL in Merchant Center, and which method fits me?

* Where we say "in our experience", this is what we have seen on our clients’ listings, not a rule of the sources named above. Platforms do not disclose their algorithms, so that nobody can game them, and we may be wrong.