Developer Tools

Shopify Floating WhatsApp Chat Widget with Phone Number Code

Builds a floating WhatsApp chat button for Shopify, WordPress or any site, with 30 designs, mascots and embed code.

WhatsApp Chat Widget Generator tool

Set up your WhatsApp chat button

Your design saves in this browser. Use Save link to edit it later on any device.

Result ready.

Live preview

About the WhatsApp Chat Widget Generator

A floating WhatsApp chat widget puts a WhatsApp button in the corner of every page, so a shopper can message you without leaving your store. Kwebby's free generator builds one for Shopify, WordPress or any website: enter your phone number with its country code, pick a design, a mascot and a screen position, and copy one block of embed code. You can also download the files as a zip or as a ready-made WordPress plugin.

Key Takeaways

  • The generator creates a floating WhatsApp chat button and chat popup for Shopify, WordPress, WooCommerce, Wix, Squarespace, Webflow and plain HTML sites.
  • You pick your country from 220+ calling codes and type your local number; the tool builds the correct wa.me link and removes the leading 0.
  • A setup agent reads your store description or URL and writes the greeting, quick replies and button text, then picks a design, colors and a mascot.
  • You choose from 30 designs, 3 popup layouts, 4 button shapes, 13 mascots, 5 animations and 5 screen positions, with separate settings for phones.
  • The prefilled message can include the product name and link with {title} and {url}, so you know which product the shopper means.
  • Install takes about 2 minutes: paste the code before </body> in Shopify's theme.liquid, or upload the WordPress plugin zip.
  • The widget is free, needs no account, loads in about 12 KB and sends no visitor data to Kwebby.

What Is a Floating WhatsApp Chat Widget?

A floating WhatsApp chat widget is a small button that stays fixed in a corner of the screen while visitors scroll. A click opens a chat popup with your greeting, or opens WhatsApp directly with a message already typed.

The button uses WhatsApp's click-to-chat links (https://wa.me/<number>). WhatsApp opens on the shopper's phone, or WhatsApp Web and the desktop app on a computer. You answer from your normal WhatsApp or WhatsApp Business app, so there is no new inbox to learn.

How the WhatsApp Widget Generator Works

The generator has a setup agent and 6 editing steps. A live preview on a sample store shows every change on desktop and phone screens.

  1. Setup agent (optional). Describe what you sell and what customers ask, or paste your store URL. The agent reads your page title, theme color and platform, then writes your messages and picks a design, colors, a mascot and a position. Your phone number is never sent to the AI.
  2. Number. Select your country code and type your WhatsApp number. Add up to 5 team members, such as Sales and Support, each with their own number and avatar.
  3. Messages. Set the popup title, status line, greeting, prefilled message, button text, up to 4 quick replies and a teaser bubble.
  4. Design. Start from 30 designs, then change the layout, light or dark theme, colors, button shape, icon, size, corner radius and animation.
  5. Mascot. Pick one of 13 mascots, such as a support agent, robot, cat or owl, for the popup header and the floating button.
  6. Placement. Click a spot on the desktop and phone screen maps, set the distance from the edges, choose devices and hide the button on chosen pages.
  7. Behavior. Choose a chat popup or a direct WhatsApp link, auto-open timing, a notification badge, click tracking and business hours.

Press Get my embed code to open the install panel with code and steps for each platform. Save link stores your design in a URL, so you can edit it later on any device.

How to Add a Floating WhatsApp Chat Widget to Shopify

Shopify does not include a WhatsApp button, so most stores add one with an app or a code snippet. The snippet below works in every Shopify theme, including Dawn and other Online Store 2.0 themes, and adds no app fees.

Option 1: Paste the Code in theme.liquid

  1. Build your widget above and click Get my embed code, then open the Shopify tab and copy the code.
  2. In Shopify admin, go to Online Store > Themes.
  3. Next to your live theme, click the three dots (...) and choose Edit code.
  4. Under Layout, open theme.liquid.
  5. Press Ctrl+F (Cmd+F on a Mac) and search for </body>.
  6. Paste the code on the line just above </body> and click Save.
  7. Open your store in a new tab. The WhatsApp button shows on every page.

Option 2: Use a Custom Liquid Section (No Code Editor)

  1. Go to Online Store > Themes > Customize.
  2. In the left panel, find the Footer group and click Add section.
  3. Choose Custom Liquid, paste the same code and click Save.

The footer group loads on every page, so the button does too. Shopify checkout pages do not load theme code, so the button never covers the payment form.

Send the Product Name with the Message

Shoppers on a product page often ask about size, stock or delivery. Add {title} and {url} to the prefilled message, for example: Hi! I have a question about {title}: {url}. On a product page, the widget replaces them with the product title and link, so the chat starts with the exact item.

Keep the Button Clear of the Sticky Cart Bar

Many Shopify themes show a sticky Add to cart bar at the bottom of the screen on phones. Set Distance from the bottom (phone) to about 80 px in the Placement step, so the WhatsApp button sits above the bar. The setup agent does this for you when it detects a Shopify store.

Shopify WhatsApp Button Code Example

Here is what the generated code looks like. The first script holds your settings, and the second loads the widget.

<!-- WhatsApp Chat Widget: free generator at https://kwebby.com/whatsapp-chat-widget -->
<script>
window.KwebbyWA = {
  "phone": "919876543210",
  "message": "Hi! I have a question about {title}",
  "title": "Chat with us",
  "greeting": "Hi there! How can we help you today?",
  "color": "#25D366",
  "position": "br"
};
</script>
<script src="https://kwebby.com/embed/whatsapp-widget.js" async></script>
<!-- End WhatsApp Chat Widget -->

The phone value is the full international number in digits only: country code first, then the number, with no plus sign, spaces or leading 0. Use the generator to get the complete code with your design.

How to Add a WhatsApp Chat Widget to WordPress

Option 1: Upload the Plugin Zip

The generator packs your design into a small WordPress plugin. It works with any theme and with WooCommerce.

  1. Open the WordPress tab in the install panel and click Download plugin.
  2. In WordPress admin, go to Plugins > Add New Plugin > Upload Plugin.
  3. Choose kwebby-whatsapp-widget-wordpress.zip, click Install Now, then Activate.

To change the design later, edit it on this page, download a new zip, then delete the old plugin and upload the new one.

Option 2: Paste the Code with WPCode

  1. Install the free WPCode plugin (Insert Headers and Footers).
  2. Open Code Snippets > Header & Footer.
  3. Paste the embed code in the Footer box and click Save Changes.

Classic themes also accept the code in footer.php just before </body>. Use a child theme, because a theme update replaces footer.php.

How to Add a WhatsApp Chat Widget to a Custom Website

Paste the embed code just before the closing </body> tag of every page, or once in your shared footer template. Site builders have a footer code box:

Platform Where to paste the code
HTML website Before </body> on every page, or in the footer include
Wix Settings > Custom code > Add custom code > Body - end, all pages
Squarespace Settings > Advanced > Code injection > Footer
Webflow Site settings > Custom code > Footer code, then publish
BigCommerce Storefront > Script Manager > Create a script > Footer, all pages
React or Next.js Load the config and script once in the root layout with your framework's script component

The Download zip tab gives you self-hosted files: the widget script, an HTML snippet, a Shopify snippet, a demo page and a README. Self-hosted files load nothing from kwebby.com.

How the Phone Number and Country Code Work

WhatsApp click-to-chat links need the full international number: the country calling code, then the national number, in digits only. A number written as +91 098765 43210 becomes 919876543210 in the link.

The generator does this for you. Select your country, type the number the way you write it locally, and the tool removes spaces, dashes and the leading 0. You can also paste a full number that starts with + or 00, and the tool picks the country from it.

Country Calling code Local format wa.me link
India +91 098765 43210 wa.me/919876543210
United States +1 (415) 555-0132 wa.me/14155550132
United Kingdom +44 07700 900123 wa.me/447700900123
United Arab Emirates +971 050 123 4567 wa.me/971501234567
Brazil +55 (11) 91234-5678 wa.me/5511912345678

Click Test it next to the chat link to check that it opens the right WhatsApp account before you install the widget.

Design Options

The widget fits any store brand, and every option shows in the live preview:

  • 30 designs made for stores such as fashion, beauty, jewelry, electronics, pets, food delivery, education and B2B services.
  • 3 popup layouts: Classic chat (a WhatsApp-style bubble on a chat background), Minimal (clean white card) and Profile card (large avatar on a gradient header).
  • 4 button shapes: circle, rounded square, pill with text and side tab.
  • 3 button icons: the WhatsApp logo, a chat bubble or your mascot with a small WhatsApp badge.
  • 13 mascots: support agent, sales agent, robot, chat bubble, cat, owl, fox, panda, bear, penguin, bunny, parrot and chef.
  • Colors: button, header and header text colors, with 12 preset swatches and a full color picker.
  • 5 animations: pulse, bounce, shake, glow or none. Visitors who turn on reduced motion never see the animation.
  • Light and dark themes, button size from 44 to 80 px and corner radius from 0 to 28 px.

Placement Options

Setting Options
Desktop position Bottom right, bottom left, bottom center, middle right, middle left
Phone position Bottom right, bottom left, bottom center
Distance from edges 0 to 200 px from the side, 0 to 300 px from the bottom, set apart for desktop and phones
Devices All devices, phones only or desktop only
Hidden pages Up to 10 paths, such as /cart or /account

Bottom right is the default because visitors expect a chat button there. Use bottom left when a cookie banner, a review badge or another app already sits in the right corner.

Behavior and Business Hours

  • Chat popup or direct link. The popup greets visitors and offers quick replies; the direct link opens WhatsApp in one click.
  • Auto open. The popup opens by itself after a set number of seconds, once per visit.
  • Notification badge. A red 1 on the button draws the eye until the visitor opens the chat once.
  • Teaser bubble. A short note such as "Need help? Chat with us" appears next to the button after a delay.
  • Business hours. Set open days, hours and a time zone. Outside those hours, the popup shows "Away right now" and your offline message, or the button hides.
  • Team routing. With 2 to 5 team members, the popup lists each person with their role, and each opens a chat with their own number.

Track WhatsApp Clicks in Google Analytics 4

Turn on click tracking in the Behavior step. Each chat click then sends a whatsapp_click event to Google Analytics 4 (gtag.js), Google Tag Manager (dataLayer) and a Contact event to the Meta Pixel, when those tools run on your site. Mark whatsapp_click as a key event in GA4 to count WhatsApp chats as conversions. Nothing is sent to Kwebby.

Hosted Embed Code vs Download Zip

Hosted embed code Download zip
Setup Paste one block of code Upload the script, then paste the snippet
Updates and fixes Automatic Download again to update
Loads from kwebby.com (cached, about 12 KB gzipped) Your own server or theme
Best for Most Shopify, WordPress and custom sites Strict privacy or content security policies
WordPress Paste with WPCode Installable plugin zip

Hire Kwebby to Install It

Kwebby can place the widget for you. We install it on your Shopify, WordPress or custom site, match it to your theme, keep it clear of cart bars, cookie banners and other apps, and test it on phones and desktops. Click Hire us to place it under the live preview, and the quote form opens with your widget design attached. You get a fixed quote before any work begins.

Kwebby also builds and redesigns online stores. See web development and the website cost calculator for larger projects.

These free tools help you reach shoppers on WhatsApp and social media:

  • QR Code Generator creates a QR code for your wa.me link, for packaging, flyers and shop counters.
  • Social Stats Checker builds share links for Facebook, X, LinkedIn, Pinterest, Reddit and WhatsApp.
  • Open Graph Generator sets the preview image and title that WhatsApp shows when someone shares your product link.
  • Flag Counter adds a widget that shows each visitor the flag of their country.
  • Website Cost Calculator estimates the cost of a new store or website with AI.

Final Thoughts

A WhatsApp chat button turns product questions into conversations at the moment a shopper hesitates. Set your number with the right country code, pick a design that fits your store, place the button clear of your cart bar and paste one block of code. If you would rather not touch your theme, hire Kwebby to install and test it for you.

FAQ

Frequently asked questions

How do I add a floating WhatsApp button to Shopify without an app?

Build the widget on this page and copy the Shopify embed code. In Shopify admin, open Online Store > Themes > Edit code, open theme.liquid and paste the code just above </body>. Save, and the floating WhatsApp button shows on every page with no app fees.

How do I write my WhatsApp phone number with the country code?

Write the country calling code, then your national number, in digits only, with no plus sign, spaces, dashes or leading 0. An Indian number +91 098765 43210 becomes 919876543210. The generator converts the number for you when you select your country.

Is the WhatsApp chat widget free?

Yes. The generator, the hosted embed code, the zip download and the WordPress plugin are free, with no signup and no message limits. The popup shows a small "Free WhatsApp widget by Kwebby" credit link.

Does the WhatsApp widget slow down my store?

No. The script is about 12 KB gzipped, loads with the async attribute after your page content, and draws inside a shadow DOM, so your theme CSS and the widget never affect each other.

Can I send the product name in the WhatsApp message?

Yes. Add {title} and {url} to the prefilled message. On a Shopify product page, they become the product title and product link, so the chat starts with the item the shopper was viewing. {page} adds the page path and {site} adds your domain.

Can I add more than one WhatsApp number?

Yes. Turn on "Route chats to team members" and add up to 5 people, each with a name, role, country code, number and avatar. The popup lists them, and each opens a chat with that person's number.

Does the widget work with WhatsApp Business?

Yes. The widget uses standard click-to-chat links, which work with both the WhatsApp and WhatsApp Business apps. Enter the number registered on your WhatsApp Business account.

Can I show the WhatsApp button only on mobile?

Yes. In the Placement step, set "Show on" to Phones only. You can also set different positions and distances for phones and desktops, and hide the button on pages such as /cart.

Kwebby builds software too

Need a website or app built?

Get 50% off your first project. The discount applies to your first fixed quote only. Kwebby has delivered 1,200+ projects on fixed quotes from $100.

Step 1 of 3 · What do you need?

Get a fixed quote

50% off your first project. Applies to your first fixed quote only.

What do you need?

Pick an option to see its starting price and typical timeline.