WhatsApp Button
Add a floating “Chat on WhatsApp” button to any website. One click opens a WhatsApp conversation with a pre-filled message — the simplest way to start conversations from your site.
How It Works
- Add a single script tag to your website
- A floating WhatsApp button appears in the corner
- Visitors click it and WhatsApp opens with a pre-filled message
- The conversation flows into your SendHub inbox
No API keys, no tokens, no backend. Just a phone number and a script tag.
Setup
Paste this before the closing </body> tag:
<script
src="https://sendhub.ai/wa-button.js"
data-phone="14155551234"
data-message="Hi, I have a question"
data-color="#25D366"
data-label="Chat with us"
data-position="right"
async
></script>
Replace 14155551234 with your WhatsApp number (country code, no +).
Configuration
| Attribute | Required | Default | Description |
|---|---|---|---|
data-phone | Yes | — | WhatsApp number (country code without +) |
data-message | No | Hi, I have a question | Pre-filled message in WhatsApp |
data-label | No | Chat with us | Button text |
data-color | No | #25D366 | Button color (WhatsApp green) |
data-position | No | right | left or right corner |
data-offset-bottom | No | 24 | Pixels from bottom edge |
data-offset-side | No | 24 | Pixels from side edge |
data-hide-label-mobile | No | true | Show icon only on mobile |
data-include-product-name | No | true | Append product name on product pages (Shopify) |
Shopify Theme Editor
If you use Shopify, no code needed:
- Go to Online Store > Themes > Customize
- Add the SendHub WhatsApp Button block
- Enter your WhatsApp number
- Customize label, color, and position
- Save and publish
Comparison: Button vs Chat Widget
| Feature | WhatsApp Button | Web Chat Widget |
|---|---|---|
| Interaction | Opens WhatsApp app | Chat in browser |
| AI replies | Via your WhatsApp channel | Built-in AI |
| Visitor info needed | Has WhatsApp | Anonymous |
| Setup | Phone number only | Widget token from dashboard |
| Best for | Direct WhatsApp contact | Website-first conversations |
Use the button when you want visitors on WhatsApp. Use the widget when you want them chatting on your site.
Troubleshooting
Button doesn’t appear
- Check
data-phoneis set with a valid number - Verify the script URL is correct
WhatsApp doesn’t open
- Ensure the phone number includes the country code without
+ - Remove any spaces, dashes, or parentheses from the number