Skip to main content

BigCommerce Integration: Stencil Snippets

Learn how to add new Stencil snippets to your BigCommerce store

Paulius avatar
Written by Paulius
Updated over 2 weeks ago

Omnisend snippets connect your BigCommerce Stencil store with Omnisend, enabling essential features such as cart recovery, sales tracking, signup forms, the product picker, and more. For newer stores, these snippets are added automatically. If you're using an older store version, you’ll need to manually add the snippets using BigCommerce’s Script Manager.

This article provides instructions for adding Stencil snippets to complete your BigCommerce integration.

Using a Blueprint theme? Follow the BigCommerce Blueprint Snippets guide instead.


Before You Begin

  • Before adding snippets, you need to connect your BigCommerce store to Omnisend.

  • You can use only one snippet type at a time: Stencil or Blueprint. Mixing both will break functionality. If you're not sure which theme you're using, check BigCommerce’s guide.

  • When switching themes, you must re-add the snippets. Theme changes remove existing code.

  • Snippets are added automatically for new BigCommerce stores. If you see an error message like the one below, you’ll need to add them manually using the steps in this guide.

Adding the Snippets

Step 1. Find your store ID.

To activate the tracking scripts, you must replace XXXXX with your actual shop ID. Without it, the code won’t work.

You can locate your shop ID in the address bar while logged into your BigCommerce control panel. If you need help finding it, refer to BigCommerce’s guide.

Store Hash in the address bar

Step 2. Upload Scripts to BigCommerce Script Manager

Next, upload three scripts to your store using BigCommerce’s Script Manager. Go to Storefront Script Manager in your BigCommerce admin panel.

⚠️ Before uploading, ensure the following settings are applied to each script:

  • Placement: Footer

  • Script category: Essential

  • Script type: Script

You will repeat these steps three times, pasting different script content and selecting the correct Location for each.

Script 1: Omnisend Script

  • Name: Omnisend script

  • Location: Storefront pages

Paste the following script:

<script type="text/javascript">
// SOUNDEST-V6-SM
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://omnisnippet1.com/";
SOUNDEST.jsFile = "bigcommerce-launcher.js";
SOUNDEST.version = new Date().toISOString().slice(0, 13);
SOUNDEST.pageType = "{{page_type}}";
SOUNDEST.productTitle = "{{product.title}}";
SOUNDEST.productID = "{{product.id}}";
SOUNDEST.categoryTitle = "{{category.name}}";
SOUNDEST.categoryID = "{{category.id}}";
SOUNDEST.token = "{{settings.storefront_api.token}}";
!(function (baseURL, version) {
for (
var t = document.getElementsByTagName("script"), o = !1, s = 0;
s < t.length;
s++
)
"string" == typeof t[s].src &&
0 < t[s].src.indexOf(SOUNDEST.jsFile) &&
(o = !0);
if (!o) {
var i = document.createElement("script");
(i.type = "text/javascript"),
(i.async = !0),
(i.src = baseURL + "inshop/" + SOUNDEST.jsFile + "?v=" + version);
var r = document.getElementsByTagName("script")[0];
r.parentNode.insertBefore(i, r);
}
})(SOUNDEST.baseURL, SOUNDEST.version);
</script>

Script 2: Omnisend Sales Tracking Script

  • Name: Omnisend Sales Tracking script

  • Location: Order confirmation

Paste the following script:

<script type="text/javascript">
// SOUNDEST-V6-SM
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://omnisnippet1.com/";
SOUNDEST.jsFile = "bigcommerce-launcher.js";
SOUNDEST.version = new Date().toISOString().slice(0, 13);
SOUNDEST.pageType = "{{page_type}}";
SOUNDEST.productTitle = "{{product.title}}";
SOUNDEST.productID = "{{product.id}}";
SOUNDEST.categoryTitle = "{{category.name}}";
SOUNDEST.categoryID = "{{category.id}}";
SOUNDEST.token = "{{settings.storefront_api.token}}";
!(function (baseURL, version) {
for (
var t = document.getElementsByTagName("script"), o = !1, s = 0;
s < t.length;
s++
)
"string" == typeof t[s].src &&
0 < t[s].src.indexOf(SOUNDEST.jsFile) &&
(o = !0);
if (!o) {
var i = document.createElement("script");
(i.type = "text/javascript"),
(i.async = !0),
(i.src = baseURL + "inshop/" + SOUNDEST.jsFile + "?v=" + version);
var r = document.getElementsByTagName("script")[0];
r.parentNode.insertBefore(i, r);
}
})(SOUNDEST.baseURL, SOUNDEST.version);
</script>

💡 This script uses the same code as the Omnisend Script

Script 3: Omnisend Checkout Tracking Script

  • Name: Omnisend checkout tracking script

  • Location: Checkout

Paste the following script:

<script type="text/javascript">
// SOUNDEST-V6-SM
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://omnisnippet1.com/";
SOUNDEST.jsFile = "bigcommerce-checkout-launcher.js";
SOUNDEST.version = new Date().toISOString().slice(0, 13);
SOUNDEST.pageType = "{{page_type}}";
SOUNDEST.productTitle = "{{product.title}}";
SOUNDEST.productID = "{{product.id}}";
SOUNDEST.categoryTitle = "{{category.name}}";
SOUNDEST.categoryID = "{{category.id}}";
SOUNDEST.token = "{{settings.storefront_api.token}}";
!(function (baseURL, version) {
for (
var t = document.getElementsByTagName("script"), o = !1, s = 0;
s < t.length;
s++
)
"string" == typeof t[s].src &&
0 < t[s].src.indexOf(SOUNDEST.jsFile) &&
(o = !0);
if (!o) {
var i = document.createElement("script");
(i.type = "text/javascript"),
(i.async = !0),
(i.src = baseURL + "inshop/" + SOUNDEST.jsFile + "?v=" + version);
var r = document.getElementsByTagName("script")[0];
r.parentNode.insertBefore(i, r);
}
})(SOUNDEST.baseURL, SOUNDEST.version);
</script>

Be sure to replace XXXXX with your actual shopID in each script. See Step 1 if you need help finding it.

Once all scripts are added and saved, your BigCommerce store will be fully connected to Omnisend tracking.

Contacts Syncing

All contacts added or updated via BigCommerce will be automatically added to your Omnisend AudienceContacts list. These contacts will also receive the tag "source: bigcommerce".

This allows you to easily filter and segment contacts synced from BigCommerce. You can create a segment based on Tag is source:bigcommere. Learn more about segments here.

FAQ

Why didn't snippets install automatically after I connected my store?
Automatic snippet installation works for most new BigCommerce stores, but some older stores or custom Stencil themes require manual installation. After connecting your store, check Script Manager within 10 minutes. If no Omnisend scripts appear, follow the manual installation steps in this guide.

How do I check if Omnisend snippets are already installed?
Go to BigCommerce → Storefront → Script Manager. Look for three Omnisend scripts: "Omnisend script" (Storefront pages), "Omnisend Sales Tracking script" (Order confirmation), and "Omnisend checkout tracking script" (Checkout). If all three appear, snippets are installed

I added snippets manually, but forms and Product Picker don't work. Why?
You likely have duplicate snippets (automatic + manual). Go to BigCommerce → Storefront → Script Manager. If Omnisend scripts are listed there, remove any snippets you manually added to your theme's footer or header files. Keep only the scripts in Script Manager. Duplicate snippets break functionality.

Can I use both Blueprint and Stencil snippets at the same time?
No. Using both will break functionality. Use only one snippet type based on your theme. If you switch from Blueprint to Stencil (or vice versa), remove old snippets first, then add the correct ones.


Want to talk to support? Use the in-app chat or send your questions to [email protected].

Did this answer your question?