← All posts
Guides7 min read

[GUIDES] · Jul 8, 2026 · 14:50

WooCommerce live chat: three ways to install it and train the AI on your store policies

Inject the widget with a snippet plugin, a wp_head hook, or a child theme, dodge the JS-delay caching trap, then point the AI at your shipping and returns pages so pre-sale questions get answered at 2 a.m.

Tm

The muro team

muro.chat

#woocommerce#live chat#ecommerce#wordpress#ai support#conversion

Someone is on one of your product pages right now with their card out. They have one question left: does this ship to Belgium, will it arrive before Friday, does the medium run small. If the answer is not on the page and there is no way to ask, they open a new tab and buy from a store that answers. That is the whole business case for live chat on a WooCommerce store. It is not a support cost. It is a conversion tool that happens to also do support.

This guide is store-specific. We already published a general guide to adding AI live chat to WordPress; this one covers the WooCommerce angle: three ways to inject the widget (snippet plugin, wp_head hook, child theme), the caching plugin traps that hit stores hardest, and how to train an AI on your shipping and returns policies so pre-sale questions get answered instantly while order-specific problems come to you.

Why chat converts on a store

A visitor who asks a question on a product page is not a support ticket. They are a buyer with an objection. On a store, the questions are almost always one of five:

  • Shipping: how much, how long, do you ship to my country
  • Sizing and fit: does it run small, what is the difference between the M and the L
  • Stock: when will this variant be back, can I backorder it
  • Compatibility: will this work with the thing I already own
  • Discounts: does the coupon from your popup apply to this product

Every one of these has an answer that already exists somewhere on your site. The visitor did not find it, and they will not go looking. Answer within a minute and you usually win the sale; that is the entire pitch. You do not need a case study to believe it. Read the replies to your own abandoned cart emails and count how many of them are questions.

Step 0: grab your widget snippet

Create a muro account (14-day free trial, no card), add your store as a site, and copy the widget snippet. It looks like this:

html<script>
  (function(w,d,s,o){
    w.MuroChat=o;w[o]=w[o]||function(){(w[o].q=w[o].q||[]).push(arguments)};
    var j=d.createElement(s);j.async=1;j.src='https://muro.chat/widget.js';
    d.getElementsByTagName('head')[0].appendChild(j);
  })(window,document,'script','muro');
  muro('init',{widgetId:'YOUR_WIDGET_ID'});
</script>

The script is about 6 KB and loads async, so it will not drag down your PageSpeed score. That matters on WooCommerce, where you are probably already fighting your theme and a page builder for every point of Core Web Vitals. Now, three ways to get it into your store's <head>.

The two-minute version: install a snippet plugin like WPCode or Code Snippets, paste the widget code into the header section, save. Done, sitewide. This is the right choice if you do not maintain a child theme and do not want to touch PHP. The only real objection is plugin fatigue: a typical WooCommerce store already runs twenty-plus plugins, and every one of them is another update to review. If that bothers you, option 2 does the same job with a few lines in a file you already have.

Option 2: hook into wp_head from functions.php

WordPress fires the wp_head action while rendering the <head> of every page, and WooCommerce pages are no exception. Add this to the end of your child theme's functions.php:

html// Add to the end of your child theme's functions.php.
add_action( 'wp_head', function () {
  // Optional: keep checkout distraction-free (see note below).
  if ( function_exists( 'is_checkout' ) && is_checkout() ) {
    return;
  }
  ?>
<script>
  (function(w,d,s,o){
    w.MuroChat=o;w[o]=w[o]||function(){(w[o].q=w[o].q||[]).push(arguments)};
    var j=d.createElement(s);j.async=1;j.src='https://muro.chat/widget.js';
    d.getElementsByTagName('head')[0].appendChild(j);
  })(window,document,'script','muro');
  muro('init',{widgetId:'YOUR_WIDGET_ID'});
</script>
<?php
} );

The is_checkout() check is optional, and I show it because it is the most common request: plenty of store owners want checkout distraction-free. Think twice before you keep it, though. A shipping question at checkout is a sale in its final seconds, and a fast answer is the difference between a completed order and an abandoned one. If in doubt, load the widget everywhere and let your own numbers argue otherwise.

Option 3: paste it into header.php

The old-school route. Copy header.php from your parent theme into your child theme, open it, and paste the snippet just before the closing </head> tag. It works, and some people like seeing the script literally in the template. The trade-off: you now own a frozen copy of header.php. When the parent theme ships an updated header (new menu markup, schema, a notice bar), your copy wins and you have to merge the changes by hand. Use this route only if you already maintain a customized header for other reasons. Otherwise wp_head gives you the same result with none of the maintenance.

Where should the widget show? Think like a shopper

WooCommerce ships conditional tags that let you scope the widget precisely inside the wp_head hook. Here is how I would call each page type:

  • Product pages (is_product()): yes, always. This is where pre-sale questions live and where chat pays rent.
  • Cart (is_cart()): yes. Shipping cost surprise is the classic abandonment trigger, and this is the page where it hits.
  • Checkout (is_checkout()): your call, as covered above. I lean yes.
  • My Account (is_account_page()): yes. This is where customers land when they wonder where an order is. Meet them there.

The caching plugin gotcha

This is the part that generates the "widget does not show up" tickets. WooCommerce stores almost always run an optimizer (WP Rocket, LiteSpeed Cache, Autoptimize, or similar), and most of them offer a delay-JavaScript feature that postpones third-party scripts until the visitor interacts with the page. Result: the chat bubble appears late, or never for a visitor who only scrolls. Two fixes:

  1. 01Add muro.chat (or widget.js) to your optimizer's exclusion list so it is never delayed or deferred. The widget is around 6 KB and already async, so excluding it will not measurably move your scores.
  2. 02After installing, purge every cache layer (plugin, server, CDN) and test in a private browser window. Logged-in admins usually bypass the page cache, so "works for me" proves nothing about what shoppers actually see.

Train the AI on your policies, not your gut

Here is where a store setup differs from a blog or a SaaS. The pre-sale questions above are repetitive, and you already answered them in pages you wrote months ago. In muro you train the AI by importing a URL: point it at a page and its content becomes grounded knowledge the AI answers from. For a store, import these first:

  • Your shipping policy (rates, zones, delivery estimates)
  • Your returns and refund policy
  • Your size guide or fit notes
  • Your FAQ page
  • Payment and security info, if you keep a page for it

From then on, "how long does shipping to Canada take" gets an instant answer pulled from your own policy page instead of a guess, at 2 a.m. on a Saturday. The widget UI itself ships in 12+ languages, so a French shopper gets a French chat window even if your store copy is English. On the Solo plan at $19 a month you get 1,000 managed AI credits monthly (one credit equals one AI action), and if you would rather run unlimited AI, paste your own Claude API key and pay Anthropic directly at zero markup.

Handoff: order questions need a human with order access

The AI should not answer everything, and that matters more on a store than anywhere else. "Where is my order", "I want a refund", "I ordered the wrong size": these need someone who can open the WooCommerce admin, pull up the order, and check the tracking number. The AI cannot see your orders, and an invented shipping status is worse than silence.

muro's AI is built to get out of the way in exactly these cases: it hands off to a human when it is unsure, and specifically for refunds, account-specific issues, and visitors who are getting angry. The conversation lands in your shared inbox with the full transcript attached, so you see what was already said before you type a word.

A few features earn their keep on the human side of store support:

  • Saved replies for the "where is my order" dance: one canned response asking for the order number, one for "here is your tracking link".
  • Email forwarding with reply-by-email: answer order questions from your phone without opening a dashboard, which is where most Sunday order questions get handled.
  • Automation rules to tag conversations mentioning "refund" or "order" so they never sit behind pre-sale small talk.
  • Unlimited agents on every plan: you, your cofounder, and your VA can all work the inbox with no per-seat bill.
✦ ✦ ✦

Setup, start to finish: create a site in muro, paste the snippet with WPCode or the wp_head hook, exclude widget.js from your optimizer, then import your shipping and returns pages so the AI can answer the questions that are quietly costing you sales tonight. Want to poke a working widget first? There is a live demo. Thirty minutes now, and the next "does this ship to Belgium" becomes an order instead of an abandoned cart.

✦ Try it

One support inbox for all your projects, one flat price.

muro is live chat, an AI that answers from your own docs, and a shared inbox for every site you run. See it both sides in the live demo, check the flat pricing, or see how muro compares. It's the same snippet on every platform — browse every install guide.

Tm

✎ Written by

The muro team

muro.chat