3

我想启用 Google Trusted Stores 代码,而无需订阅白金级(我使用的是黄金级计划)。我已经通过 ShipWorks 成功设置了自动化的每日发货和取消订阅源。我相信我在 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 -->

我必须在网站上输入订单确认模块代码。问题是弄清楚 Est。发货日期和预计日期。交货日期并放入“循环”以获取订单中每个项目的请求数据。我在 order.html 页面上放置了以下代码:

<!-- 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 -->
4

2 回答 2

2

我已尝试使用徽章代码并成功获得批准。至于转换模块。对于 EST 发货日期和 EST 交货日期,我必须使用 javascript 进行“破解”:

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

我把它放在 order.html 下我正在检查其他一些选项,因为您的代码在交货日期和发货日期不完整。当我与一些 bigcommerce 的人交谈时,他们说这些变量是根据您是白金时提供的客户信息填充的(这意味着它们甚至不存在于 bigcommerce 上)

如果您找到其他东西或者它是否适合您,请告诉我。也请不要忘记购买和安装您自己的 ssl

于 2015-02-11T16:44:56.187 回答
0

根据我在 Bigcommerce 的经验,这是不可能的。他们已将 GTS 所需的数据限制为仅在其系统输出的代码中可用,而在其他文件中不可用。基本上,即使我们知道变量是什么,我也不相信它们会起作用,因为它们不是全局范围。

我猜如果您可以使用 GTS 来销售您的产品,那么从黄金到铂金级别的小幅价格上涨将很快在您的销售中弥补。

于 2015-02-06T15:50:49.120 回答