How do I add a WhatsApp chat button to my website?

Paste a short piece of code into your website, just before the closing body tag. A WhatsApp button opens a chat with your number on the visitor's phone. A website chat box lets them talk to your AI Agent without leaving your site. Either way the chats land in your inbox.

Checked 23 November 2026 against Sonar itself.

1. A WhatsApp chat button

The simplest: a green button in the corner of your site. Tapping it opens WhatsApp with your number and, if you like, a first message ready, so the customer only has to press send.

In Sonar, open WhatsApp numbers, then Get customers to message you. Copy the Website chat button code and paste it just before your page's closing body tag. The same place gives you your chat link (for your Instagram bio, emails and invoices) and a QR code to print.

2. A chat box answered by your AI Agent

For visitors who'd rather not leave your site: a chat bubble where they talk to your AI Agent, at any hour. Every chat lands in your inbox, where your team can step in.

In Sonar's Settings, open Connected apps, then Website chat. Press Switch on, then copy the code and paste it on every page, just before the closing body tag. Most website builders have a box for this, called something like "custom code" or "footer scripts". You can limit it to your own websites. Each AI reply counts as one of your plan's messages. The AI Agent answers by itself on plans that include it, from Plus. On other plans, or with the AI Agent off, chats wait in the inbox for your team.

Which to use

The button suits people who live on WhatsApp and want an answer on their phone. The chat box suits quick questions from people browsing on a computer. Many businesses use both. How the AI Agent answers is in the AI Agent guide. Every other way to start chats is in Get customers to message you.

Need a hand?

Email [email protected] with your website's address. We'll tell you where the code goes for your website builder.