Conversion Tracking and Google Customer Reviews
The store settings allow you to insert a tracking script on the order confirmation page: Google Customer Reviews, a Google Ads conversion, a Meta pixel, or any other tracking tool. This is the only place on your site where an external tool can receive details about an order that has actually been confirmed.
The script is inserted only on the order confirmation page, and only once per order. If the visitor refreshes this page or returns to it later, the script is not re-executed: your conversions are never counted twice.
Where to find the setting
- Open the store settings.
- Select the “Conversion Tracking” section.
- Check the box next to “Enable the tracking script on the order confirmation page.”
- Click “Edit Tracking Script” and paste your code.
- Publish the site: the script is sent to your server upon publication.
Available placeholders
Before insertion, WebAcappella automatically replaces the following placeholders with the actual order data. They are enclosed in double curly braces, and it’s up to you to add quotation marks around them if your script requires them.
| Placeholder | Content |
|---|---|
| {{ORDER_ID}} | Order ID |
| {{ORDER_EMAIL}} | Customer email address |
| {{ORDER_COUNTRY}} | Delivery country code, in ISO format (FR, BE, CH...) |
| {{ORDER_DELIVERY_DATE}} | Estimated delivery date, in YYYY-MM-DD format |
| {{ORDER_DATE}} | Order date, in YYYY-MM-DD format |
| {{ORDER_AMOUNT}} | Total order amount, including shipping |
| {{ORDER_AMOUNT_SHIPPING}} | Shipping cost only |
| {{ORDER_AMOUNT_NO_SHIPPING}} | Total amount excluding shipping |
| {{ORDER_CURRENCY}} | Currency code (EUR, CHF...) |
Text values are automatically sanitized before being inserted into your script: an email address or reference containing a special character cannot break your code.
Use Case: Google Customer Reviews
Google Customer Reviews offers customers the option, immediately after placing an order, to receive an invitation later to rate their purchase. The ratings collected contribute to your reputation as a seller on Google.
Three conditions must be met on Google’s end before anything can be displayed:
- Have an active Google Merchant Center account.
- Sign up for the Customer Reviews program through this account and wait for Google to approve it. This approval is not immediate.
- Retrieve your merchant ID, which is displayed in Merchant Center.
The “Example for Google Customer Reviews” button in this section inserts the code below, which is already populated with the correct placeholders. All you need to do is replace YOUR_MERCHANT_ID with your merchant ID:
<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": YOUR_MERCHANT_ID,
"order_id": "{{ORDER_ID}}",
"email": "{{ORDER_EMAIL}}",
"delivery_country": "{{ORDER_COUNTRY}}",
"estimated_delivery_date": "{{ORDER_DELIVERY_DATE}}"
});
});
};
</script>
The badge that displays your rating throughout the site is a separate code, different from this one. It should not be pasted into this section, but rather into the custom HTML code in the site’s general settings, so that it appears on all pages—not just the order confirmation page.
Estimated Delivery Date
Google Customer Reviews needs an estimated delivery date to send its invitation at the right time. This date comes from a setting available in each shipping method: “Estimated delivery time (days).” This timeframe is added to the order date to generate the {{ORDER_DELIVERY_DATE}} tag.
If the timeframe is not specified, the placeholder returns the order date itself. The script remains functional, but the invitation will be sent too early.
The delivery time is locked into the order at the time of purchase. Changing this setting later affects only future orders, never those that have already been placed.
Test Without Paying
A deferred payment method allows you to place a test order on your own store without any money changing hands, and to reach the actual confirmation page.
- Temporarily enable a deferred payment method: bank transfer, check, or cash on delivery.
- Publish the site.
- Place an order on your own store by selecting this payment method.
- The confirmation page that appears will contain your script.
- Delete the test order from the order management section once verification is complete.
An order runs the script only once. Reloading the confirmation page will therefore not display anything additional; this is normal behavior, not a malfunction.
To verify a correction without having to place a new order each time, the “Conversion Tracking” section offers the option “Replay the script each time the order confirmation page is displayed.” Enable this option, publish the site, then reload the confirmation page for your test order as many times as necessary.
Disable this option once your checks are complete, then publish the site again. As long as it’s enabled, each time you reload the confirmation page, it counts as an additional conversion in your tracking tool.
The script doesn’t seem to be doing anything
The symptom is the same regardless of the cause: the confirmation page displays normally, with nothing else happening. Go through the following steps in order.
- The site has been republished since the script was last modified. Until the site is republished, your server will continue to use the old version.
- The “Enable tracking script on the order confirmation page” checkbox is selected.
- The order you’re looking at hasn’t already triggered the script during a previous session. The verification option described above disables this restriction during debugging.
- No ad blockers are active in the browser used for testing. Most block apis.google.com, which is enough to prevent the prompt from appearing.
- The browser console (F12 key) does not report any errors in your script. A missing quotation mark or comma will break the entire block.
- For Google Customer Reviews: Your enrollment in the program is confirmed in Merchant Center, and the merchant ID matches the registered account.
- For Google Customer Reviews: The order’s shipping country is covered by the program. Google does not display the invitation in all countries.
After your enrollment is approved, it may take Google several days to actually activate the invitation display. A valid script may therefore have no visible effect at first, even though nothing needs to be corrected.
Other Uses
This section isn’t limited to Google Customer Reviews. Any tracking code that relies on the details of a confirmed sale can be used here: Google Ads conversions, Meta pixels, and affiliate tracking. The {{ORDER_AMOUNT}}, {{ORDER_CURRENCY}}, and {{ORDER_ID}} placeholders then send the order amount and ID to your tool.
Consent and Personal Data
This script is inserted as-is, without going through the site’s cookie consent banner. The banner’s strict mode applies only to Google Analytics and Google Tag Manager, not to the code you paste here.
Google Customer Reviews sends your customer’s email address to Google in order to send them the invitation. Mention this data transfer in your privacy policy and ensure it remains consistent with the consent you collect, especially if your customer base is located in a country with a strict interpretation of the GDPR.