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

  1. Add a single script tag to your website
  2. A floating WhatsApp button appears in the corner
  3. Visitors click it and WhatsApp opens with a pre-filled message
  4. 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

AttributeRequiredDefaultDescription
data-phoneYesWhatsApp number (country code without +)
data-messageNoHi, I have a questionPre-filled message in WhatsApp
data-labelNoChat with usButton text
data-colorNo#25D366Button color (WhatsApp green)
data-positionNorightleft or right corner
data-offset-bottomNo24Pixels from bottom edge
data-offset-sideNo24Pixels from side edge
data-hide-label-mobileNotrueShow icon only on mobile
data-include-product-nameNotrueAppend product name on product pages (Shopify)

Shopify Theme Editor

If you use Shopify, no code needed:

  1. Go to Online Store > Themes > Customize
  2. Add the SendHub WhatsApp Button block
  3. Enter your WhatsApp number
  4. Customize label, color, and position
  5. Save and publish

Comparison: Button vs Chat Widget

FeatureWhatsApp ButtonWeb Chat Widget
InteractionOpens WhatsApp appChat in browser
AI repliesVia your WhatsApp channelBuilt-in AI
Visitor info neededHas WhatsAppAnonymous
SetupPhone number onlyWidget token from dashboard
Best forDirect WhatsApp contactWebsite-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-phone is 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