Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable the Google Trusted Stores without having Platinum Level in Bigcommerce

I would like to enable the Google Trusted Stores code without having to subscribe to the Platinum Level (I'm on a Gold Level plan). I have successfully set up automated daily Shipping and Cancellation Feeds through ShipWorks. I believe I set up the "Badge" code correctly on the footer.html:

<!-- BEGIN: Google Trusted Stores -->
<script type="text/javascript">
    var gts = gts || [];

    gts.push(["id", "######"]);
    gts.push(["badge_position", "BOTTOM_RIGHT"]);
    gts.push(["locale", "en_AU"]);
    gts.push(["google_base_offer_id", "%%GLOBAL_ProductId%%"]);
    gts.push(["google_base_subaccount_id", "8669332"]);
    gts.push(["google_base_country", "AU"]);
    gts.push(["google_base_language", "en_AU"]);

    (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 -->

I have to put the Order Confirmation Module Code on the website. The issue is figuring out the Est. Ship Date and Est. Delivery Date and putting in a "loop" to get the requested data for each item in the order. I have placed the following code on the order.html page:

<!-- start order and merchant information -->
   <span id="gts-o-id">%%GLOBAL_OrderId%%</span>
   <span id="gts-o-domain">www.****.com.au</span>
   <span id="gts-o-email">%%GLOBAL_CurrentCustomerEmail%%</span>
   <span id="gts-o-country">%%GLOBAL_ShipCountry%%</span>
   <span id="gts-o-currency">%%GLOBAL_CurrencyName%%</span>
   <span id="gts-o-total">%%GLOBAL_OrderTotal%%</span>
   <span id="gts-o-discounts">%%GLOBAL_CouponDiscount%%</span>
   <span id="gts-o-shipping-total">%%GLOBAL_ShippingPrice%%</span>
   <span id="gts-o-tax-total">%%GLOBAL_TaxCost%%</span>
   <span id="gts-o-est-ship-date">ORDER_EST_SHIP_DATE</span>
   <span id="gts-o-est-delivery-date">ORDER_EST_DELIVERY_DATE</span>
   <span id="gts-o-has-preorder">N</span>
   <span id="gts-o-has-digital">N</span>
<!-- end order and merchant information -->

<!-- start repeated item specific information -->
<!-- item example: this area repeated for each item in the order -->
<span class="gts-item">
    <span class="gts-i-name">%%GLOBAL_ProductName%%</span>
    <span class="gts-i-price">%%GLOBAL_ProductPrice%%</span>
    <span class="gts-i-quantity">%%GLOBAL_ProductQuantity%%</span>
    <span class="gts-i-prodsearch-id">%%GLOBAL_ProductId%%</span>
    <span class="gts-i-prodsearch-store-id">######</span>
    <span class="gts-i-prodsearch-country">AU</span>
    <span class="gts-i-prodsearch-language">en_AU</span>
</span>
<!-- end item 1 example -->
<!-- end repeated item specific information -->

</div>
<!-- END Google Trusted Stores Order -->
like image 229
Mayura Wijewickrama Avatar asked Nov 19 '25 13:11

Mayura Wijewickrama


1 Answers

I have tried with the code for the badge and successfully got approved. as far as the conversion module. I had to do a "Hack" with javascript for the EST ship date and EST delivery date:

 <!-- Include the conversion tracking code for all analytics packages -->
            <!-- START Google Trusted Stores Order -->
    <div id="gts-order" style="display:none;" translate="no">

    <!-- start order and merchant information -->
    <span id="gts-o-id">%%ORDER_ID%%</span>
    <span id="gts-o-domain">www.doubletakeshapewear.com</span>
    <span id="gts-o-email">%%ORDER_EMAIL%%</span>
    <span id="gts-o-country">%%GLOBAL_ShipCountry%%</span>
    <span id="gts-o-currency">%%GLOBAL_CurrencyName%%</span>
    <span id="gts-o-total">%%ORDER_AMOUNT%%</span>
    <span id="gts-o-discounts">%%GLOBAL_CouponDiscount%%</span>
    <span id="gts-o-shipping-total">%%GLOBAL_ShippingPrice%%</span>
    <span id="gts-o-tax-total">%%GLOBAL_TaxCost%%</span>
     <span id="gts-o-est-ship-date"></span>
<script>
var today = new Date();
var tomorrow = new Date();
tomorrow.setDate(today.getDate()+3);
if(tomorrow.getMonth() <= 8){
        var fecha = tomorrow.getFullYear()+'-'+'0'+(tomorrow.getMonth()+1)+'-'+tomorrow.getDate();
} else{
    var fecha = tomorrow.getFullYear()+'-'+(tomorrow.getMonth()+1)+'-'+tomorrow.getDate();
}
document.getElementById("gts-o-est-ship-date").innerHTML = fecha;
</script>

     <span id="gts-o-est-delivery-date"></span>
<script>
var today2 = new Date();
var tomorrow2 = new Date();
var j =document.getElementById("gts-o-country").innerHTML;
if( j != 'US'){
if( 
tomorrow2.setDate(today.getDate()+4);
if(tomorrow2.getMonth() <= 8){
        var fecha2 = tomorrow2.getFullYear()+'-'+'0'+(tomorrow2.getMonth()+1)+'-'+tomorrow2.getDate();
} else{
    var fecha2 = tomorrow2.getFullYear()+'-'+(tomorrow2.getMonth()+1)+'-'+tomorrow2.getDate();
}
document.getElementById("gts-o-est-delivery-date").innerHTML = fecha2;
}else{
tomorrow2.setDate(today.getDate()+20);
if(tomorrow2.getMonth() <= 8){
        var fecha2 = tomorrow2.getFullYear()+'-'+'0'+(tomorrow2.getMonth()+1)+'-'+tomorrow2.getDate();
} else{
    var fecha2 = tomorrow2.getFullYear()+'-'+(tomorrow2.getMonth()+1)+'-'+tomorrow2.getDate();
}
document.getElementById("gts-o-est-delivery-date").innerHTML = fecha2;
}
</script>

    <span id="gts-o-has-preorder">N</span>
    <span id="gts-o-has-digital">N</span>
    <!-- end order and merchant information -->

    <!-- start repeated item specific information -->
    <!-- item example: this area repeated for each item in the order -->
    <span class="gts-item">
        <span class="gts-i-name">%%GLOBAL_ProductName%%</span>
        <span class="gts-i-price">%%GLOBAL_ProductPrice%%</span>
        <span class="gts-i-quantity">%%GLOBAL_ProductQuantity%%</span>
        <span class="gts-i-prodsearch-id">%%GLOBAL_ProductId%%</span>
        <span class="gts-i-prodsearch-store-id">483911</span>
        <span class="gts-i-prodsearch-country">US</span>
        <span class="gts-i-prodsearch-language">en_US</span>
    </span>
    <!-- end item 1 example -->
    <!-- end repeated item specific information -->

    </div>
    <!-- END Google Trusted Stores Order -->

I put this under the order.html I'm checking some other options because your code is uncomplete on the delivery date and ship date. when I spoke with some bigcommerce people they said that this variables are populated from customer information that is given when you are platinum ( which means that they don't even exist on bigcommerce )

Please let me know if you find something else or if it works for you. also please don't forget to purchase and install your own ssl

like image 122
Juan Mrad Avatar answered Nov 22 '25 03:11

Juan Mrad