These snippets have been created for BigCommerce Blueprint themes. 

The snippets have been updated on September 25, 2018. Here are the old snippets, if you want to replace them. Please go to Store settings > Connected store for a full setup wizard.

We do not recommend to continue using the old snippets as the following features will not be supported:

  • Sales tracking
  • Abandoned Cart
  • Live View
  • Product Picker
  • Forms

IMPORTANT: if you are changing the template, you will need to add our snippets again. Do not add both snippets at a time (Blueprint and Stencil), neither of them will work in such case. 

Not sure, which theme you are using? Check BigCommerce guide to find out.
 

Adding the snippets

IMPORTANT: you need to replace the shop ID (currently XXXXXX) with the shop ID of your store. Otherwise the code will not work. You can find your store's shop ID in the address bar when you are logged into your store's control panel. 


1. GOOGLE ANALYTICS TAB

  • Go to Advanced Settings > Web Analytics, then open the Google Analytics tab. Copy and paste the code below.
  • If Google Analytics (GA) tracking code is already added there,  Omnisend sales tracking code should be placed below GA tracking tag. 
<script type="text/javascript">
    // SOUNDEST-V6-1
    // Do not remove these comments, they are super important!
    window.SOUNDEST = window.SOUNDEST || {};
    // Do not forget to replace XXXXXX with your shop ID! You can find it in your shop's permanent address: https://store-XXXXXX.mybigcommerce.com/. How to find it: https://goo.gl/1XddvQ
    SOUNDEST.shopID = "XXXXXX";
    SOUNDEST.shopType = "bigcommerce";
    SOUNDEST.eventsHost = "https://events.soundestlink.com/";
    (function(r,s,c){try{if(0<r.length&&0<s.length&&0<c.length){var u=!0,e=null,l=[],p=function(n){var e,t,o,a=document.cookie.split(";"),i=n+"=";for(/mybigcommerce.com/.test(location.hostname)&&(i=n+"-"+r+"="),t=0;t<a.length;t+=1)0===(o=a[t].trim()).indexOf(i)&&(e=o.substring(i.length,o.length));return e},n=function(){if(!u&&0<l.length){for(var n=0;n<l.length;n++){var e=document.createElement("img"),t=["timestamp="+(new Date).getTime(),"shopBaseURL="+window.location.protocol+"//"+window.location.hostname+"/","shopID="+r,"shopType="+s,"orderID="+l[n],"source=ga"],o=p("omnisendAnonymousID"),a=p("omnisendSessionID"),i=p("omnisendContactID"),d=p("omnisendAttributionID");void 0!==o&&t.push("anonymousID="+o),void 0!==a&&t.push("sessionID="+a),void 0!==i&&t.push("contactID="+i),void 0!==d&&t.push("attributionID="+d),e.src=c+"events/saveNewsletterOrder/?"+t.join("&"),document.body.appendChild(e)}l=[]}};if(void 0!==window.pageTracker){var t=window.pageTracker._addTrans,o=window.pageTracker._addItem,a=window.pageTracker._trackTrans;window.pageTracker._addTrans=function(n){e=n,t.apply(this,arguments)},window.pageTracker._addItem=function(n){e=n,o.apply(this,arguments)},window.pageTracker._trackTrans=function(){null!=e&&-1===l.indexOf(e)&&l.push(e),e=null,n(),a.apply(this,arguments)}}else window.pageTracker={_addTrans:function(n){e=n},_addItem:function(n){e=n},_trackTrans:function(){null!=e&&-1===l.indexOf(e)&&l.push(e),e=null,n()}};"loading"!==document.readyState?(u=!1,n()):document.addEventListener?document.addEventListener("DOMContentLoaded",function(){u=!1,n()}):document.attachEvent("onreadystatechange",function(){"loading"!==document.readyState&&(u=!1,n())})}}catch(n){}})(SOUNDEST.shopID,SOUNDEST.shopType,SOUNDEST.eventsHost);
</script>


2. Panels/Footer.html

<div id="soundest-container"></div>
<script type="text/javascript">
    // SOUNDEST-V6-2-B
    // Do not remove these comments, they are super important!
    window.SOUNDEST = window.SOUNDEST || {};
    // Do not forget to replace XXXXXX with your shop ID! You can find it in your shop's permanent address: https://store-XXXXXX.mybigcommerce.com/. How to find it: 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-V6-3-B
    // Do not remove these comments, they are super important!
    window.SOUNDEST = window.SOUNDEST || {};
    SOUNDEST.productID = "%%GLOBAL_ProductId%%";
</script>


4. Snippets/FastCartThickBoxContent.html:

<!-- SOUNDEST-V6-4-B -->
<!-- Do not remove these comments, they are super important! -->
<!-- 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-V6-5-B -->
<!-- Do not remove these comments, they are super important! -->
<!-- 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%% -->

 

Contacts

Your contacts will be send to All contacts list and for all newly added and updated contacts via Bigcommerce, we will add a tag “source: bigcommerce”. That way you will be able to create a segment and filter the list of contacts that were added from Bigcommerce. Just create a segment on Profile data where tag is “source: bigcommerce”.

Learn more about segments here.
 

Additional information

For Stencil codes please click here
Which theme platform do you have: Stencil or Blueprint?
 

Did this answer your question?