Skip to content

Instantly share code, notes, and snippets.

@Lewiscowles1986
Last active February 10, 2017 10:59
Show Gist options
  • Save Lewiscowles1986/39c87d4de8e91ce1cd2917361ba93aa4 to your computer and use it in GitHub Desktop.
Save Lewiscowles1986/39c87d4de8e91ce1cd2917361ba93aa4 to your computer and use it in GitHub Desktop.
Google Trusted stores crap

Badge

from https://support.google.com/trustedstoresmerchant/answer/6063080?hl=en

<!-- BEGIN: Google Trusted Stores -->
<script type="text/javascript">
    var gts = gts || [];
    gts.push(["id", "STORE_ID"]);
    gts.push(["badge_position", "USER_DEFINED"]);
    gts.push(["badge_container", "GTS_CONTAINER"]);
    gts.push(["locale", "PAGE_LANGUAGE"]);
    //gts.push(["google_base_offer_id", "ITEM_GOOGLE_SHOPPING_ID"]);
    //gts.push(["google_base_subaccount_id", "ITEM_GOOGLE_SHOPPING_ACCOUNT_ID"]);
    
    (function() {
        var gts = document.createElement("script");
        gts.type = "text/javascript";
        gts.async = true;
        gts.src = "https://www.googlecommerce.com/trustedstores/api/js";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(gts, s);
    })();
</script>
<!-- END: Google Trusted Stores -->

then

<div id="GTS_CONTAINER"></div>

Order Confirmation Screen

from https://support.google.com/trustedstoresmerchant/answer/6063087?hl=en

<!-- START Google Trusted Stores Order -->
<div id="gts-order" style="display:none;" translate="no">
    <!-- start order and merchant information -->
    <span id="gts-o-id">{{code}}</span>
    <span id="gts-o-domain">{{code}}</span>
    <span id="gts-o-email">{{code}}</span>
    <span id="gts-o-country">{{code}}</span>
    <span id="gts-o-currency">{{code}}</span>
    <span id="gts-o-total">{{code}}</span>
    <span id="gts-o-discounts">{{code}}</span>
    <span id="gts-o-shipping-total">{{code}}</span>
    <span id="gts-o-tax-total">{{code}}</span>
    <span id="gts-o-est-ship-date">{{code}}</span>
    <span id="gts-o-has-preorder">{{code}}</span>
    <span id="gts-o-has-digital">{{code}}</span>
    <!-- end order and merchant information -->
    
    <!-- start repeated item specific information -->
    <!-- (repeats put inside loop over items) -->
    <span class="gts-item">
        <span class="gts-i-name">{{code}}</span>
        <span class="gts-i-price">{{code}}</span>
        <span class="gts-i-quantity">{{code}}</span>
        <!-- CDATA[<span class="gts-i-prodsearch-id">{{code}}</span>] -->
        <!-- CDATA[<span class="gts-i-prodsearch-store-id">{{code}}</span>] -->
    </span>
    <!-- end repeated item specific information -->
</div>
<!-- END Google Trusted Stores Order -->

Platforms

BigCommerce

  • You have to be a pro or enterprise customer
  • with an SSL
  • you'll need valid GTIN numbers for every product you intend to send to Google
  • you'll either use BigCommerce Admin UI, or need an app to mark products as for google
  • your site will likely need remittive works
  • It's a total Pita
  • Estimated cost £2,500+

Sources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment