These snippets are dedicated for BigCommerce Stencil themes. 

These snippets have been updated on September 25, 2018. Here are the old snippets, if you want to replace them. Please go to My Account > Connected store for a complete setup wizard.

We do not suggest continuing the use of old snippets as the following features will not be supported:

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

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

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


Adding the snippets

IMPORTANT: you need to replace the shopID (currently XXXXX) with your own shopID, otherwise the code will not work. You can find your ID in the address bar when you are logged in to your store control panel. If you cannot find it, check out BigCommerce guide on it or go to My Account > Connected store for a complete setup wizard.

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 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. FOOTER SCRIPTS

  • Go to Storefront Design > Design Options, then click the Scripts tab.
  • Find the mentioned script in the text area labeled Footer. If you have more than one script there, add Omnisend below all of the scripts.
<div id="soundest-container"></div>
<script type="text/javascript">
    // SOUNDEST-V6-2-S
    // 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.pageType = "{{#if page_type}}{{page_type}}{{/if}}";
    SOUNDEST.productTitle = "{{#if product}}{{product.title}}{{/if}}";
    SOUNDEST.productID = "{{#if product}}{{product.id}}{{/if}}";
    SOUNDEST.categoryTitle = "{{#if category}}{{category.name}}{{/if}}";
    SOUNDEST.categoryID = "{{#if category}}{{category.id}}{{/if}}";
    (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. VERIFY THE CODES
If you are entering the codes via the wizard (at My Account) please click Verify and Omnisend will check whether you have added all codes correctly. If you have entered them manually, please inform our support team.



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

Did this answer your question?