Validate your JavaScript implementation

Once you have implemented the required Google Trusted Stores badge code and order confirmation module code for your store, you are ready to test. To test, you must use the JavaScript validator on multiple browsers to ensure that the JavaScript code is successfully sending Google all necessary data and that there aren’t any JavaScript code errors:

To begin the process:

  1. Sign in to your account at
  2. Under Account Management, click on Stores.
  3. Click the Test button for each store
  4. Follow the steps on the JavaScript validation instructions popup. (Note that this will include a URL that you will copy and paste into each browser. You will need to place real orders to pass the validation.)

The JavaScript validator will create a special testing environment that will detect errors found on each page that you visit and provide instructions to fix these errors. Once you have identified and addressed any errors, you must re-test to ensure that the error has been resolved before you can successfully complete JavaScript validation. The JavaScript validator will overlay a yellow “Test Drive” bar at the top of each page and a preview of the Google Trusted Store badge in the bottom right corner of each page. Once you place an order on your site, you should also see a preview of the purchase protection opt-in on your order confirmation page.

What to test

To complete your testing, you must validate that the Google Trusted Stores code functions consistently across all common browsers.

For each domain and browser, you are required to test both a common page and the order confirmation page.

  • A common page is any page on your site other than the order confirmation page. Examples include the homepage, a product page, a category page, or a store policy page.
  • The order confirmation page is the page that customers are directed to after a transaction has been completed.

With the URL provided in the JavaScript validation instructions popup, proceed through an entire checkout process, and complete a transaction in order to fully test the order confirmation module. If correctly implemented, the purchase protection opt-in will appear on your order confirmation page at the end of the transaction.

Test all available checkout and payment options on your site, across various browsers, with the JavaScript validator URL to ensure that all customers will see the Google Trusted Store badge and be able to opt in for purchase protection at the end of the transaction.

If a payment method (such as PayPal) directs the customer off of your domain and onto a third-party site with no return to an order confirmation page on your own domain, the order confirmation module will not load and validation will not be successful. These orders will not be passed Google, and your customers will not be given the chance to opt in for purchase protection.

Testing should be conducted on the following browsers:

Browser Version(s)
Chrome Any version Required
Internet Explorer Version 9+ Required
Firefox Any version Required
If at any time you do not see the yellow “Test Drive” bar at the top of the page, check that the Google Trusted Stores badge code has been implemented on the page, including on all order confirmation pages and checkout pages.

“Test Drive” validator bar

When you launch the JavaScript validator URL in a browser window, the yellow “Test Drive” validator bar on the top of the page will alert you to any errors with the Google Trusted Stores JavaScript snippet(s) on the page:

  • “Failed” indicates that there are critical errors with the Google Trusted Stores JavaScript code on the page. You must correct all critical errors before you will be able to complete your application.
  • “Passed with warnings” indicates that there are non-critical errors with the Google Trusted Stores JavaScript code on the page. These errors will not prevent you from completing your store integration; however, merchants using Google Shopping should correct these errors to allow Google to match specific products from your store to data that you have provided for Google Trusted Stores.
  • “All validation items have been passed” indicates that there are no errors found on the page.

Select Click to see details of validation errors in the validator bar to view the validation errors; click Learn more under each error for guidance to address the error.

You may return to your account’s “Overview” page at any time to see a summary of your validation results.

Completing JavaScript validation

To complete JavaScript validation for each store, you must address every critical error and re-test until each page passes the validator on all required browsers. Refer to the the list of JavaScript validation errors for guidance in troubleshooting.

Refer to the ”Overview” page of your Google Trusted Stores Merchant account to review your validation status. Once all items have “Passed” or “Passed with warnings”, your store integration is considered complete.

Was this article helpful?