Validate your JavaScript implementation

Once you have implemented the required Google Trusted Stores JavaScript badge code and order confirmation module code on your site, you must use the JavaScript Validator Tool to test the implementation code for each store on multiple browsers to ensure that the Javascript is successfully sending Google all necessary data.

When you launch the JavaScript Validator Tool on your site, the JavaScript Validator Tool will create a 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 will successfully complete JavaScript validation.

What to test

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

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 is customers are directed to after a transaction has been completed.

To test, launch the JavaScript Validator Tool, proceed through an entire checkout process, and complete a transaction in order to fully test the order confirmation module code. If correctly implemented, the Google Trusted Stores order confirmation module appear on your order confirmation page at the end of the transaction.

Tip

Test all available checkout and payment options on your site, across various browsers, with the JavaScript Validator Tool 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.

Testing should be conducted on the following browsers:

Browser Version(s)
Chrome Any version Required
Internet Explorer Version 9+ Required
Firefox Any version Required
Firefox Version 3 Recommended*

* To ensure consistency across all the browsers that your customers may be using, we strongly recommend that you test Firefox 3.

Launch the JavaScript Validator Tool

To launch the JavaScript Validator Tool:

  1. Sign in to your Google Trusted Stores Merchant account.
  2. Navigate to the “Code” section.
  3. Click the Test Code button at the bottom of the page.
  4. On the “Test Code” page, navigate to the “Select a store” drop-down menu and choose the domain you would like to test.
  5. Click Test Now to begin the validation process.*

When you click Test Now, you will be redirected to your store’s main homepage. The JavaScript Validator Tool 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. If you place an order on your site, you should also see a preview of the order confirmation module on your order confirmation page.

Tip

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.

* Alternatively, once you select a domain from the drop-down menu, an additional link to the testing environment will be generated. You can copy and paste this link into your browser to create the same testing environment or share it with other members of your team. This link will remain active for only five days; at the link expires, you may generate another URL.

“Test Drive” validator bar

When you launch the JavaScript Validator Tool, the yellow “Test Drive” validator bar on the top of each 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 snippet(s) 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 snippet(s) on the page. These errors will not and will not prevent you from completing your Google Trusted Stores program application; however, merchants using Google Shopping should correct these errors to allow Google to correlate 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.

    If you have not yet submitted your Google Trusted Stores application, you may return to your account’s “Overview” section to find a summary of validation results.

    Preview the Google Trusted Store badge

    While validating the JavaScript on the various browsers above, hover over the Google Trusted Store badge to preview the shipping and customer service performance grades that will be available to shoppers. Google will not begin calculating performance metrics until you have completed technical integration and entered the monitoring period; any metrics shown on the badge prior to your application submission will be a sample and not reflective of your account’s actual performance.

    We also recommend that you preview your logo on the expanded badge at this time. If you are unsatisfied with the appearance of your logo, you can submit a revised file in your Google Trusted Stores Merchant account.

    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 browsers. Refer to the the list of JavaScript validation errors for guidance in troubleshooting.

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