ZhiDesk
FeaturesPricingGuidesFAQLog inStart free trial
Updated 2026-09-30 · ZhiDesk

How to add live chat to a website, step by step

Adding live chat to a website takes about ten minutes with almost any modern chat tool. The work is the same everywhere: get an embed snippet, paste it into every page, and test. This guide walks through each platform, then covers the things that usually go wrong: HTTPS, caching, consent banners and single-page apps.

Before you start

The embed snippet

A typical snippet loads a small script asynchronously so it never slows down your page. The ZhiDesk version looks like this:

<script>
(function(d){
  var j=d.createElement('script');
  j.src='https://skzhidesk.com/static/widget.js';
  j.async=1;
  j.dataset.appid='YOUR_APPID';
  j.dataset.host='https://skzhidesk.com';
  d.head.appendChild(j);
})(document);
</script>

Replace YOUR_APPID with the ID from your dashboard. The rule for every platform: place it once, site-wide, just before the closing </body> tag.

Plain HTML sites

  1. Open your shared footer template, or each HTML file if the site has no template.
  2. Paste the snippet directly above </body>.
  3. Upload the files and reload the site. The chat button appears in the bottom corner.

WordPress

Avoid editing theme files directly: theme updates overwrite them. Use a code-snippet plugin instead.

  1. In the WordPress admin, go to Plugins → Add New and install a header/footer code plugin such as WPCode.
  2. Open its footer section, paste the snippet and save.
  3. Clear any caching plugin (WP Rocket, LiteSpeed Cache, W3 Total Cache) and reload.

Full details, including block themes and caching pitfalls: WordPress live chat guide.

Shopify

  1. In Shopify admin open Online Store → Themes, then … → Edit code on your live theme.
  2. Open layout/theme.liquid.
  3. Paste the snippet just above </body> and save.

Checkout pages are controlled by Shopify and generally do not run theme scripts, so the widget appears on storefront pages. More: Shopify live chat with translation.

WooCommerce

WooCommerce runs on WordPress, so use the same plugin method. The widget will appear on product, cart and checkout pages because they are ordinary WordPress pages.

Site builders (Wix, Squarespace, Webflow and similar)

Most builders have a "custom code" or "code injection" setting, often on paid plans only. Add the snippet to the site-wide footer area and publish. If your plan has no custom code option, you may need to upgrade the builder plan.

Single-page apps (React, Vue, Next.js)

Load the script once in the root HTML template (for example index.html or the root layout). Don't inject it inside a component that re-renders, or you'll load the widget repeatedly.

Test it properly

  1. Open the site in a private window and on your phone.
  2. Send a test message and confirm it arrives in the agent inbox.
  3. Reply and confirm the visitor sees it.
  4. Test in another language: change your phone language or write in Spanish, and confirm translation works.
  5. Go offline in the workspace and check the offline message form.

Troubleshooting

SymptomLikely causeFix
No chat buttonPage cache still serves the old HTMLPurge the cache/CDN and reload with a private window.
Button appears only on some pagesSnippet added to one template onlyMove it to a site-wide footer.
Console shows "mixed content"Snippet uses http://Use the https:// snippet only.
Widget blocked until consentCookie banner blocks third-party scriptsCategorize the chat script as functional in your consent tool.
Rejected on a new domainAllowed-domain list doesn't include itAdd the domain in your chat settings.

Does live chat slow down my site?

A well-built widget loads asynchronously after the page content, so it shouldn't affect how quickly your page appears. Check with PageSpeed Insights before and after installation if you want to be sure.

FAQ

Can I add live chat to my website for free?

Yes. Several tools have free tiers, and ZhiDesk offers a 7-day free trial with no payment details required. Check what free plans exclude, such as translation, branding removal or history retention.

Where should I put the live chat code?

Once per site, in a site-wide footer, just before the closing body tag, so the widget loads on every page without delaying your content.

Do I need a developer to add live chat?

No. On WordPress, Shopify and most site builders you paste the snippet into a settings box or theme file. A developer is only helpful for single-page apps or strict content-security policies.

Try ZhiDesk free for 7 days. Add multilingual live chat with two-way translation to your website in minutes. No payment required to start.
Start free trial