Google Trusted Stores – Magento Integration Guide

Share On Facebook
Share On Twitter
Share On Linkedin


What is a Google Trusted Store?

Google Trusted Stores is a program that helps shoppers feel confident in their purchases on the web. A Trusted Store shows customers that they will receive great customer service, on-time delivery and free purchase protection. The protection is offered to customers who place orders from these stores and opt into the program at the time of purchase.

Google Trusted Stores is a free certification program to highlight that your company offers consistent excellent shopping experiences. Once your store has been qualified, your store will be acknowledged with a badge that is displayed on your site and on Google Shopping.

Google says “applying to become a Trusted Store is now simpler than ever. You only need to create an account and add two snippets of code to your website.” Well, applying to become a Trusted Store is simple but adding those snippets of code is quite tricky in Magento. Since every single order is different, you will need to pull dynamic information and getting the correct code from Magento may be tricky for some. So we have written down the code that we use which will save you time!

Trusted Badge Code Snippet

The Google Trusted Stores badge code must be implemented on every page of your website, including (but not limited to) the home page, category pages, browse pages, search results pages, product pages, help pages, shopping cart pages, checkout pages, and order confirmation pages. The code should be placed just before the closing tag of each page.

Below is the default code which needs to be modified with your information

*Be sure to modify the words that are capitalized

For more specific information, please view their support document.

Success Page Snippet

In addition to the Google Trusted Store badge code which must be placed on all pages, you must include the order confirmation module on the order confirmation page that appears once an order has been processed on your site.

The order confirmation module allows customers to opt-in to the Google Trusted Stores program and also transmits the necessary transaction information to Google. Because this module triggers the purchase protection opt-in and the Google Trusted Stores customer survey opt-in, the order details in this module must be accurate to the best of your ability.

This is the basic code. The items that are capitalized need to be modified. We have provided the code we used in Magento in the next section.

This is the modified Magento Code:

For more specific information, please view their support document.

After this code is implemented and it passes the test, you should notify Google that you are ready to start your 30-day test period. During this trial, your eCommerce customers may be invited to complete a survey after completing their order. If Google approves your store in 30 days, then the badge will appear in your template.

Rate this post
  • David G.

    Thank you for the great post. I’m having an issue with the Trusted Badge Code you posted. The only way I can get it to work is by removing this line of code:
    gts.push([“google_base_offer_id”, “getID(); } else {echo “-1″;} ?>”]);

    Of course, when I remove the line then Google reports a warning that the product ID is missing (which isn’t the end of the world). One thing I realized is that in my Merchant account I have the Google Product ID set to the Magento SKU, not the Magento product ID. I tried changing “getID()” to “getSku()” but that didn’t work either (I’m not much of a programmer, in case you haven’t guessed). Any ideas?

    • Hi David,

      Based to your comment, it looks like you may have implented the code incorrectly. The Google Base Offer ID line should read:

      gts.push([“google_base_offer_id”, “getSku(); } else {echo “-1″;} ?>”]);

      This will display the SKU of your products on your product pages and display -1 on all other pages.

      Try changing your code to this and let us know if it works for you.


      • David G.


        I’ve tried both of these:

        gts.push([“google_base_offer_id”, “getSku(); } else {echo “-1″;} ?>”]);


        gts.push([“google_base_offer_id”, “getSku(); } else {echo “-1″;} ?>”]);

        As well as the original line in the post:

        gts.push([“google_base_offer_id”, “getID(); } else {echo “-1″;} ?>”]);

        In each of these instances I did not see the bar across the top of the screen while validating the code in Trusted Stores. As soon as I remove the line of code it works, but I get the warning.

        • David G.

          I just noticed that when I copy/paste code here in my post some of it gets truncated. Disregard my last post, as the code I provided isn’t what I typed in. Thank you for trying to help, though.

  • Ari

    “The code should be placed just before the closing tag of each page.”

    I’m not sure which pages exactly this refers too. For example would I include this on the page categorysearch.phtml? Can someone please give me a list of the pages that this code needs to be added too.