这些片段是为 BigCommerce Blueprint 主题创建的。 如果您目前有其中一个,我们建议升级到我们的新Blueprint片段。
这些片段在这里供参考,以便您了解应该用新片段替换哪些内容。 我们建议执行以下操作:
删除旧片段(见下文)
添加新的片段(请参阅此文章)
这样您就不会混淆,一切将正常运行。 请前往商店设置 > 已连接的商店,以获取完整的设置向导。
这些片段在2018年9月25日之前是有效的。 如果要替换这些片段,这里是新的片段。 我们不建议继续使用旧片段,因为以下功能将不再支持:
销售跟踪
购物车恢复
实时视图
产品选择器
表单
重要提示:如果您正在更改模板,则需要再次添加这些片段。 请勿同时添加旧版和新版片段(Blueprint 和 Stencil),否则这两者都不能正常工作。
不确定您正在使用哪个主题? 查看 BigCommerce 指南以了解详情。
添加片段
重要提示:您需要将商店ID(目前为 XXXXXX)替换为您商店的实际商店ID。 否则,代码将不起作用。 您可以在登录商店的控制面板时,于地址栏中找到您的商店ID。
1. GOOGLE ANALYTICS 标签页
进入高级设置 > 网络分析,然后打开Google Analytics标签页。 复制并粘贴以下代码。
如果已经在此处添加了Google Analytics (GA) 追踪代码,Omnisend 销售跟踪代码应放在 GA 追踪标签下方。
<script type="text/javascript">
// SOUNDEST-V5-1
// 请勿移除这些注释,它们非常重要!
window.SOUNDEST = window.SOUNDEST || {};
// 请勿忘记用您的商店 ID 替换 XXXXXX! 您可以在商店永久地址中找到它:https://store-XXXXXX.mybigcommerce.com/。 如何找到它:https://goo.gl/1XddvQ
SOUNDEST.shopID = "XXXXXX";
SOUNDEST.shopType = "bigcommerce";
SOUNDEST.eventsHost = "https://events.soundestlink.com/";
(function(e,n,a){try{if(e.length>0&&n.length>0&&a.length>0){var t=!0,o=null,d=[],r=function(){if(!t&&d.length>0){for(var o=0;o<d.length;o++){var r=document.createElement("img"),i=["timestamp="+(new Date).getTime(),"shopBaseURL="+window.location.protocol+"//"+window.location.hostname+"/","shopID="+e,"shopType="+n,"orderID="+d[o],"source=ga"];r.src=a+"events/saveNewsletterOrder/?"+i.join("&"),document.body.appendChild(r)}d=[]}};if(void 0!==window.pageTracker){var i=window.pageTracker._addTrans,c=window.pageTracker._addItem,s=window.pageTracker._trackTrans;window.pageTracker._addTrans=function(e){o=e,i.apply(this,arguments)},window.pageTracker._addItem=function(e){o=e,c.apply(this,arguments)},window.pageTracker._trackTrans=function(){void 0!==o&&null!==o&&-1===d.indexOf(o)&&d.push(o),o=null,r(),s.apply(this,arguments)}}else window.pageTracker={_addTrans:function(e){o=e},_addItem:function(e){o=e},_trackTrans:function(){void 0!==o&&null!==o&&-1===d.indexOf(o)&&d.push(o),o=null,r()}};"loading"!==document.readyState?(t=!1,r()):document.addEventListener?document.addEventListener("DOMContentLoaded",function(){t=!1,r()}):document.attachEvent("onreadystatechange",function(){"loading"!==document.readyState&&(t=!1,r())})}}catch(n){}})(SOUNDEST.shopID,SOUNDEST.shopType,SOUNDEST.eventsHost);
</script>
2. Panels/Footer.html
<div id="soundest-container"></div>
<script type="text/javascript">
// SOUNDEST-V5-2-B
// 请勿移除这些注释,它们非常重要!
window.SOUNDEST = window.SOUNDEST || {};
// 请勿忘记用您的商店 ID 替换 XXXXXX! 您可以在商店永久地址中找到它:https://store-XXXXXX.mybigcommerce.com/。 如何找到它:https://goo.gl/1XddvQ
SOUNDEST.shopID = "XXXXXX";
SOUNDEST.shopType = "bigcommerce";
SOUNDEST.baseURL = "https://omnisrc.com/";
SOUNDEST.version = new Date().toISOString().slice(0, 13);
SOUNDEST.productID = SOUNDEST.productID || "";
SOUNDEST.additionalData = SOUNDEST.additionalData || {};
SOUNDEST.additionalData.email = "%%GLOBAL_CurrentCustomerEmail%%";
SOUNDEST.cartItems = "%%GLOBAL_CartItems%%";
(function(t,e){try{if(t.length>0&&e.length>0&&window.location.hash.length>0&&"recoverCart"===JSON.parse(decodeURIComponent(window.location.hash.substring(1))).action){var i=document.createElement("div"),n=document.getElementById("soundest-container");i.id="soundest-cart";i.innerHTML='<div id="soundest-cart-overlay" style="position:fixed;top:0px;left:0px;width:100%;height:100%;background-color:#ffffff;z-index:1100000001;opacity:0.9;"></div><img id="soundest-cart-loader" style="position:fixed;top:50%;left:50%;margin-top:-20px;margin-left:-20px;width:40px;height:40px;z-index:1100000002;border-width:0px;" alt="" src="'+t+"inshop/images/loading.gif?v="+e+'" width="40" height="40" />';n.appendChild(i)}}catch(f){}})(SOUNDEST.baseURL,SOUNDEST.version);
(function(e,t){try{if(e.length>0&&t.length>0){var n=document.createElement("script"),c=document.getElementById("soundest-container");n.type="text/javascript";n.id="soundest-launcher";n.src=e+"inshop/bigcommerce-launcher.js?v="+t;c.parentNode.insertBefore(n,c)}}catch(f){}})(SOUNDEST.baseURL,SOUNDEST.version);
</script>
3. Snippets/ProductAddToCart.html
<script type="text/javascript">
// SOUNDEST-V5-3-B
// 请勿移除这些注释,它们非常重要!
window.SOUNDEST = window.SOUNDEST || {};
SOUNDEST.productID = "%%GLOBAL_ProductId%%";
</script>
4. Snippets/FastCartThickBoxContent.html
<!-- SOUNDEST-V5-4-B -->
<!-- 请勿移除这些注释,它们非常重要! -->
<!-- SOUNDEST-FASTCART-QUANTITY:%%GLOBAL_fastCartQuantity%% -->
<!-- SOUNDEST-FASTCART-PRICE:%%GLOBAL_fastCartProdTotal%% -->
<!-- SOUNDEST-FASTCART-LINK-IMAGE:%%GLOBAL_fastCartProdImg%% -->
<!-- SOUNDEST-CART-ITEMS:%%GLOBAL_fastCartNumItemsTxt%% -->
5. Snippets/CartItem.html
<!-- SOUNDEST-V5-5-B -->
<!-- 请勿移除这些注释,它们非常重要! -->
<!-- SOUNDEST-ITEM-%%GLOBAL_CartItemId%%-ID:%%GLOBAL_ItemId%% -->
<!-- SOUNDEST-ITEM-%%GLOBAL_CartItemId%%-QUANTITY:%%GLOBAL_ProductQuantity%% -->
<!-- SOUNDEST-ITEM-%%GLOBAL_CartItemId%%-VARIATION:%%GLOBAL_VariationId%% -->
<!-- SOUNDEST-ITEM-%%GLOBAL_CartItemId%%-PRICE:%%GLOBAL_ProductPrice%% -->
<!-- SOUNDEST-ITEM-%%GLOBAL_CartItemId%%-LINK-IMAGE:%%GLOBAL_ProductImage%% -->
<!-- SOUNDEST-ITEM-%%GLOBAL_CartItemId%%-ATTRIBUTES:%%GLOBAL_ProductOptions%% -->
<!-- SOUNDEST-ITEM-%%GLOBAL_CartItemId%%-EVENT:%%GLOBAL_EventDate%% -->
<!-- SOUNDEST-ITEM-%%GLOBAL_CartItemId%%-WRAPPING:%%GLOBAL_GiftWrappingName%% -->
<!-- SOUNDEST-CART-ITEMS:%%GLOBAL_CartItems%% -->