Add a chat button to your website

A floating WhatsApp button in the corner of your site. Visitors click it and a chat opens with your number, message ready to send.

You do not need to be technical to do this. It is one block of text pasted into your site once.

Create the widget

  1. In the sidebar, open Growth → Website widget.

    The Wap2b sidebar with Growth expanded and Website widget highlighted
    Third of the four ways to start a conversation, under Growth.
  2. Click Create widget.

    The Website widget page, empty, with the Create widget button at the top right
    You can run more than one — a second site, or a second number.
  3. Fill it in, watching the preview on the right.

    The Create widget dialog with a number, an internal name, a greeting bubble, a pre-filled message, an add-language link, a colour swatch and a bottom-left or bottom-right position choice, beside a live preview of the button
    Everything you change here shows in the preview immediately.
    • WhatsApp number — which of your numbers the chat opens with.
    • Name — internal, so you can tell widgets apart if you run more than one site.
    • Greeting bubble — the small message beside the button. Leave it blank to show just the button.
    • Pre-filled message — what is typed into the customer's box when they click.
    • Other languages — optional. A visitor whose browser is set to that language sees your translation; everyone else sees the copy above.
    • Button colour and whether it sits bottom left or bottom right.
  4. Create it, and copy the snippet.

    The Embed code dialog showing a one-line script tag with a data-key, a preview of the button, and a Copy code button
    One line. The data-key is what ties the button to your account and this widget.

Paste it, do not retype it

The snippet contains an identifier that ties it to your account. Copy the whole thing; a single missing character stops it working.

Where to paste it

You want it on every page of your site. The dialog says to put it just before the closing </body> tag, which is the conventional place for a script like this. The snippet also loads asynchronously and waits for the page, so a plugin's header box works equally well — which is why the WordPress route below uses one.

  • WordPress — use a header-and-footer-scripts plugin. Walkthrough below.
  • Shopify — Online Store → Themes → Edit code → theme.liquid, before </body>.
  • Wix / Squarespace / Webflow — look for "custom code" or "code injection" in settings, and use the footer or end-of-body option.
  • A developer built your site — send them the snippet and this sentence: "before the closing body tag, site-wide."

Pasting it into WordPress

WordPress has no box for this out of the box, so you add a small plugin that provides one. This is the standard way of doing it and takes about two minutes.

  1. In the WordPress admin, open Plugins.

    The WordPress admin sidebar with the Plugins entry highlighted
    Not Appearance — editing theme files directly is the fragile way, and an update overwrites it.
  2. Click Add Plugin.

    The WordPress Plugins screen with the Add Plugin button beside the heading
    Top of the Plugins screen, next to the title.
  3. Search for insert header and footer scripts and install one of the results.

    WordPress plugin search results for insert header and footer scripts, showing WPCode, Header and Footer Scripts, and Header Footer Code Manager, with Install Now beside each
    Any of them do the same job. Prefer one that is compatible with your version and actively updated. Activate it after installing.
  4. Open its settings — for the plugin shown here, Settings → Header and Footer Scripts.

    The WordPress Settings menu expanded with Header and Footer Scripts highlighted
    Each plugin puts itself in a slightly different place. Look under Settings first.
  5. Paste the snippet into the head scripts box.

    The Head Scripts field of the plugin containing the one-line Wap2b widget script tag
    One line, pasted whole. A footer box works too if the plugin offers one.
  6. Save settings.

    The Save settings button at the bottom of the plugin's settings page
    Leave 'delete all data on uninstall' unticked unless you mean it.
  7. Open your site and check the corner.

    A live website with the green WhatsApp button and its greeting bubble in the bottom-right corner
    The greeting bubble appears beside the button, and the visitor can dismiss it.

Setting it up well

  • The greeting bubble is the hook. "Questions? Chat with us" outperforms an unlabelled green circle by a wide margin.
  • Match the pre-filled message to the page if you can run more than one widget — a product page asking about that product beats a generic hello.
  • Bottom right is the convention. Move it left only if something else already lives there.
  • Match your brand colour, unless your site is already green-heavy, in which case a contrasting colour gets noticed more.

Watching it work

The list counts clicks per widget, so you can tell whether the button is earning its place. The Active switch turns one off without deleting it or touching your site.

The Website widget list showing one widget with its number, a click count, an Active toggle, and actions to view the embed code, edit or delete it
The first action re-opens the embed code, for when you need the snippet again.

What happens when someone clicks

On a phone, WhatsApp opens. On a desktop, WhatsApp Web or the desktop app opens. Either way the conversation lands in your Chatbox as soon as they send.

Because the customer started it, the 24-hour window is open, so the replies you type yourself are free. A reply the platform sends for you — an AI assistant, an Instant Replies answer, the away reply — is charged.

If something goes wrong

  • The button does not appear. The snippet did not save, the plugin is installed but not activated, or the page is cached. Clear your site's cache and hard-refresh.
  • It appears on one page only. It was pasted into a single page rather than the site-wide header or footer box.
  • Clicking does nothing on desktop. The visitor has no WhatsApp Web session. Normal — it works on their phone.
  • It overlaps something else in the corner. Switch it to the other side.
  • You changed a setting and nothing changed. Caching again. Give it a few minutes and hard-refresh.
  • Clicks are not counting. Check the widget is still Active, and that the site is running the current snippet rather than an older widget's.

Next

Build an opt-in page.

Still stuck?

If this page did not solve it, tell us what you were trying to do and we will pick it up from there.

Open a support ticket