Skip to main content

BigCommerce Integration: Stencil Snippets

Learn how to add new Stencil snippets to your BigCommerce store

Written by Paulius

Omnisend snippets connect your BigCommerce Stencil store with Omnisend, enabling features such as cart recovery, sales tracking, signup forms, the product picker, and more. Omnisend adds these snippets automatically for new BigCommerce stores. If you're using an older store version or custom Stencil theme, you'll need to add them manually using BigCommerce's Script Manager.

This article shows how to manually add 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.

  • 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, follow the manual installation 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

⚠️ Critical: Replace XXXXX with your shop ID in all three scripts before uploading.

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, apply these settings 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

This script tracks visitor behavior and enables signup forms, cart recovery, and the Product Picker on your storefront pages.

  • 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

This script tracks completed orders and sends sales data to Omnisend for campaign and automation performance analysis.

  • 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 Script 1.

Script 3: Omnisend Checkout Tracking Script

This script tracks checkout behavior to improve cart abandonment accuracy.

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

Note: This script uses a different file name (bigcommerce-checkout-launcher.js) than Scripts 1 and 2.

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 Segmentation in Omnisend.

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.

I updated/switched my BigCommerce theme, and now forms don't work. What happened?

Theme updates or switches remove existing scripts from BigCommerce. Go to BigCommerceStorefrontScript Manager and check if the three Omnisend scripts are still there. If they're missing, follow the manual installation steps listed above.

I see "XXXXXX" in the script code. What should I do?
Replace XXXXXX with your actual BigCommerce shop ID in all scripts. Find your shop ID in your BigCommerce admin URL: https://store-XXXXXX.mybigcommerce.com/. For example, if your URL is https://store-abc123.mybigcommerce.com/, replace XXXXXX with abc123 in each script before saving.

Cart recovery isn't working. Could it be a snippet issue?

Yes. Cart recovery requires all three scripts to work correctly. Check BigCommerce Storefront Script Manager and confirm:

  • Omnisend script is set to Storefront pages (tracks cart additions).

  • Omnisend Sales Tracking script is set to Order confirmation (tracks completed orders).

  • Omnisend checkout tracking script is set to Checkout (tracks checkout abandonment).

If any script is missing or set to the wrong Location, cart recovery won't trigger.


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

Did this answer your question?