Delay the loading of Shopify Chat Widget

Delay the loading of Shopify Chat Widget

vaultfurniture
Tourist
10 0 3

Hi there, 

I have been using the "Shopify Inbox" live chat widget, but recently figured out it is slowing my site down because it is the first thing to load on the website.  Is there a way to change the shopify chat widget so that it loads after x amount of time or after the entire page is done loading? 

(website: vaultfurniture.com --> I temporarily disabled the chat widget until I get the popup delayed)

Replies 4 (4)

Beast_Boy
Shopify Partner
41 0 0

I get how frustrating it is when something helpful like live chat slows down your website. Shopify Inbox widget supposed to load perfectly, which can have effect performance, good news is, you can delay it so it loads *after* your page or a few seconds in.

it do require a bit of custom code, but nothing too hard.

If this fixed your issue, a like and marking it solved will mean a lot to me.
I am a Shopify Specialist | Focused on helping eCommerce stores Grow - Maven
Need help with your store design or optimization, need to increase sales, support in marketing ? Let me assist..
Contact : uxmavenonline@gmail.com

Kudosi-Carlos
Trailblazer
246 25 115

Hello @vaultfurniture 

The Shopify Inbox snippet loads synchronously by default in your theme’s <head>, so it kicks off before everything else and delays your page. To defer it, you’ll move the snippet out of the head and wrap it in a small loader that fires after the page (or a timer) completes. Here’s what to do next:

1. Remove the default Inbox snippet

  • In Online Store → Themes → Edit code, open layout/theme.liquid.
  • Find the <script> block that references shopify_inbox.js in the <head> and delete or comment it out.

2. Add a deferred loader

  • Still in theme.liquid, just before the closing </body> tag, paste this:

<script>
function loadShopifyInbox() {
var s = document.createElement('script');
s.src='https://cdn.shopify.com/shopifycloud/shopify_inbox.js';
s.async = true;
document.body.appendChild(s);
}
// Option A: after full page load
window.addEventListener('load', loadShopifyInbox);
// Option B: after a 3-second delay instead
// setTimeout(loadShopifyInbox, 3000);
</script>

  • Choose Option A to load when everything’s rendered, or uncomment Option B for a fixed delay.

3. Publish and verify

  • Save your theme and open your storefront.
  • Use your browser’s Network tab to confirm shopify_inbox.js only downloads after load or your timer.
  • Test chat functionality—messages should still arrive, just loaded later.
- Was this helpful? Click Like or Mark as Solution to support the community.
- Kudosi Product Reviews – Instantly import high-quality reviews from AliExpress, Amazon, eBay, Etsy, Temu and anywhere you want. Build trust fast, boost conversions, and kickstart your sales.
Start free trial

DrewOswald
Shopify Partner
81 18 25

If you're comfortable working with code, I recommend watching this tutorial—it explains how to delay the loading of the Shopify Inbox chat widget until after the user interacts with the page:
https://www.youtube.com/watch?v=mwx1kp8gUSs&t=360s

Note: Before making any changes, be sure to duplicate your theme as a backup.

 

devDrew webDev · Need a developer? Send me a DM.
Follow me on Instagram for Shopify Tips & Tricks: https://www.instagram.com/devdrew.webdev/

Website_Speedy
Shopify Partner
135 0 4

Hello @vaultfurniture ,  Based on your question about delaying the Shopify chat widget to load after a specific time or once the entire page has loaded.

 

Here are the steps you can follow to delay the Shopify chat widget:

1. Lazy-Load the Widget

 

Use JavaScript to load the chat widget only when the user interacts with the page. Add this to your theme’s JavaScript file

 

window.addEventListener('scroll', function loadChatWidget() {

  if (!document.getElementById('chat-widget-script')) {

    const script = document.createElement('script');

    script.id = 'chat-widget-script';

    script.src='https://chat-widget-url.js';

    document.body.appendChild(script);

  }

  window.removeEventListener('scroll', loadChatWidget);

}, { once: true });

 

2. Delay Shopify Chat Widget

 

Add to theme.liquid before </body> tag

<script>

  window.addEventListener('load', function () {

    setTimeout(function () {

      const script = document.createElement('script');

      script.src="https://cdn.shopify.com/shopifycloud/shopify_chat/loader.js?shop=your-store.myshopify.com";

      script.async = true;

      document.body.appendChild(script);

    }, 4000); // Delays widget load by 5 seconds

  });

</script>