WhatsApp Business AutomationModule 5

5.2WhatsApp CRM Integration — HubSpot & Google Sheets

30 min 6 code blocks Practice Lab Quiz (4Q)

WhatsApp CRM Integration — HubSpot & Google Sheets

A WhatsApp chatbot without a CRM is like a shop with no accounting records — you're doing business but losing insight. Every customer conversation contains valuable data: what products they asked about, what price point they responded to, how many messages before they converted, and what made them leave without buying. When you integrate WhatsApp with a CRM, every conversation becomes a structured sales record that you can analyze, automate follow-ups from, and use to build better bots. This lesson connects WATI to both HubSpot (for professional agency work) and Google Sheets (for budget-conscious Pakistani SMEs).

Section 1: Google Sheets CRM Integration (Start Here)

Google Sheets is the right CRM for most Pakistani small businesses and freelancers. It's free, familiar, shareable, and powerful enough for managing hundreds of WhatsApp contacts. The integration flow:

Architecture:

code
WATI Webhook → n8n → Google Sheets CRM
(fires on every message/conversation event)

┌─────────────┐    ┌─────────────┐    ┌─────────────────┐
│   WATI       │───→│    n8n       │───→│  Google Sheets   │
│  (WhatsApp)  │    │  (webhook    │    │  (CRM database)  │
│              │    │   handler)   │    │                   │
└─────────────┘    └─────────────┘    └─────────────────┘
       ↑                                       │
       │                                       │
       └───────── Automated Follow-up ←────────┘

WATI Webhook Configuration: In WATI dashboard → Settings → Webhooks, set your n8n webhook URL as the notification endpoint. WATI will POST to your n8n URL for:

  • NEW_CONVERSATION — first message from a new contact
  • MESSAGE_RECEIVED — any incoming message
  • CONVERSATION_RESOLVED — conversation marked as done
  • CONTACT_CREATED — new contact added

n8n Webhook Handler:

javascript
// n8n Function node to process WATI webhook
const event = $json.event_type;
const contact = $json.contact;
const message = $json.message;

let row = {
  timestamp: new Date().toISOString(),
  phone: contact.whatsapp_number,
  name: contact.first_name + ' ' + contact.last_name,
  city: contact.custom_params?.city || '',
  event: event,
  message_preview: message?.text?.slice(0, 100) || '',
  conversation_id: $json.conversation_id,
  status: event === 'CONVERSATION_RESOLVED' ? 'Closed' : 'Active',
  source: contact.custom_params?.utm_source || 'Direct WhatsApp'
};

return [row];

Google Sheets CRM Structure: Create a sheet with these columns:

PhoneNameCityFirst ContactLast ActivityTotal MessagesStatusSourceTagsNotes

Use a second sheet for "Opportunities": high-value leads who've been qualified but not converted. This becomes your follow-up queue.

Automated Follow-Up from Sheets: Build an n8n workflow with a Schedule Trigger (daily at 10 AM). It reads the Opportunities sheet and for each contact where Last Activity was 3+ days ago and Status = "Active/Interested," sends a gentle follow-up WhatsApp:

code
"Assalam o Alaikum {{name}}! Just checking if you had any more questions about
{{product_of_interest}}. We have some new inventory available if you'd like to
have another look. Type HELP for assistance anytime."

Section 2: HubSpot CRM Integration (For Agency Clients)

HubSpot has a free tier that works excellently for Pakistani businesses. The WATI → HubSpot integration through n8n creates contacts, deals, and activities automatically:

Step 1 — Contact Creation: When WATI fires CONTACT_CREATED, create a HubSpot contact:

code
n8n HTTP Request node:
POST https://api.hubapi.com/crm/v3/objects/contacts
Headers: Authorization: Bearer {{$env.HUBSPOT_API_KEY}}
Body:
{
  "properties": {
    "phone": "{{$json.contact.whatsapp_number}}",
    "firstname": "{{$json.contact.first_name}}",
    "lastname": "{{$json.contact.last_name}}",
    "city": "{{$json.contact.custom_params.city}}",
    "whatsapp_source": "{{$json.contact.custom_params.utm_source}}",
    "lead_status": "NEW"
  }
}

Step 2 — Deal Creation for Qualified Leads: When your qualification bot scores a lead above the threshold, create a HubSpot Deal:

code
POST https://api.hubapi.com/crm/v3/objects/deals
{
  "properties": {
    "dealname": "{{contact_name}} - {{product_interest}}",
    "dealstage": "appointmentscheduled",
    "amount": "{{estimated_deal_value_pkr}}",
    "pipeline": "default",
    "closedate": "{{30_days_from_now}}"
  }
}

Step 3 — Timeline Activities: Log every significant WhatsApp interaction as a HubSpot Activity so sales managers can see the full customer journey:

code
POST https://api.hubapi.com/crm/v3/objects/notes
{
  "properties": {
    "hs_note_body": "WhatsApp conversation: {{message_summary}}",
    "hs_timestamp": "{{timestamp_ms}}"
  },
  "associations": [{"to": {"id": "{{hubspot_contact_id}}"}, "types": [{"associationCategory": "HUBSPOT_DEFINED", "associationTypeId": 1}]}]
}

Section 3: Analytics Dashboard

Whether you use Sheets or HubSpot, build a weekly analytics report:

  • Total conversations this week vs. last week
  • Conversion rate (conversations → closed deals)
  • Average messages before conversion
  • Top performing message templates (by response rate)
  • Leads by source (Organic WhatsApp / Instagram Ad / Website / Referral)

Send this as a WhatsApp message to the business owner every Monday morning at 9 AM via an n8n scheduled workflow. One page of numbers is more motivating than a full dashboard nobody checks.

Section 4: Data Privacy & Pakistani Regulations

WhatsApp CRM integration involves storing customer phone numbers and conversation data. In Pakistan, the Prevention of Electronic Crimes Act (PECA) 2016 and emerging data protection regulations require you to handle this responsibly:

What You Must Do:

  • Clearly tell customers their data is being stored when they first interact with the bot
  • Include an opt-out mechanism: "Type STOP to unsubscribe from messages"
  • Never share customer data with third parties without consent
  • Store phone numbers in hashed format if possible (especially in Sheets)
  • Limit data retention — delete contacts who haven't interacted in 12+ months

What You Must NOT Do:

  • Scrape WhatsApp groups for phone numbers (violates WhatsApp ToS)
  • Send unsolicited marketing messages to numbers you didn't collect through legitimate opt-in
  • Store CNIC numbers, bank details, or passwords in your CRM
  • Share customer conversation data with competitors or for marketing profiling

For Agency Clients: Include a data handling clause in your service agreement. Template:

"All customer data collected through WhatsApp automation remains the property of [Client Name]. [Your Agency] will not access, share, or retain customer data beyond the scope of providing the agreed automation services. Data will be deleted within 30 days of contract termination."

Pakistan Case Study: Karachi Fashion Retailer — From Chaos to System

Fatima runs "Threads by Fati," a Karachi-based online fashion boutique selling via Instagram and WhatsApp. Before CRM integration, her daily reality looked like this:

Before (Manual WhatsApp):

  • 60+ daily WhatsApp inquiries
  • Customer details saved in phone contacts (often lost)
  • No way to track which leads converted
  • Follow-ups: "I think I messaged her last week... maybe?"
  • Monthly revenue: PKR 180,000

After (WATI + Google Sheets CRM via n8n):

MetricBeforeAfter
Daily inquiries handled6060 (same)
Time on WhatsApp5 hours1.5 hours
Lead trackingPhone contactsGoogle Sheets CRM
Follow-up rate~20% (forgot most)95% (automated)
Conversion rate8%14%
Monthly revenuePKR 180,000PKR 310,000

The key insight: Fatima's products and prices didn't change. Her customer base didn't grow. What changed was follow-up consistency. The automated "Day 3 check-in" recovered 22% of leads who would have been lost. The Monday morning analytics report showed her that Instagram Story leads converted 3x better than DM leads — so she doubled her Story content.

Fatima's setup cost:

  • WATI: PKR 15,000/month
  • n8n self-hosted on Contabo VPS: PKR 1,800/month
  • Google Sheets: Free
  • Total: PKR 16,800/month for PKR 130,000 additional revenue = 7.7x ROI
Practice Lab

Practice Lab

Exercise 1: Set up the Google Sheets CRM structure described above for a test business. Create the two sheets (Contacts and Opportunities). Manually add 5 fictional contacts with realistic Pakistani data (names, cities, phone numbers starting with +92). Simulate what each column would contain after a real WhatsApp conversation.

Exercise 2: Build the n8n → Google Sheets webhook handler. Use WATI's test webhook sender (in WATI dashboard → Settings → Webhooks → Send Test) to fire a test event. Verify that a new row appears in your Google Sheet with the correct data. Fix any field mapping errors.

Exercise 3: Build the automated follow-up workflow (Schedule Trigger → read Opportunities sheet → send WhatsApp to inactive leads). Test it with one fictional contact. Verify the WhatsApp message is sent correctly and the "Last Activity" column updates. This closes the loop from CRM data back to customer communication.

Exercise 4: Write a data privacy notice for your WhatsApp bot. Include: what data you collect, why, how long you store it, and how customers can request deletion. Make it WhatsApp-friendly (under 200 words, use bullet points). Add it as the first message in your WATI welcome flow.

Key Takeaways

  • Google Sheets is the best starting CRM for Pakistani SMEs because it has zero cost, requires no training, and is sufficient for managing hundreds of contacts with automated n8n workflows
  • HubSpot's free tier adds pipeline visualization, deal tracking, and team collaboration — worth the setup effort for agency clients who need professional sales reporting
  • The automated follow-up from CRM data is often more valuable than the initial bot — contacting leads 3 days after their first inquiry (when the competition has forgotten about them) recovers significant revenue
  • Weekly WhatsApp analytics reports sent to the business owner create accountability and demonstrate your automation's value — clients who see metrics every week are far less likely to cancel
  • Data privacy is not optional — PECA 2016 and WhatsApp's own policies require responsible data handling, and Pakistani consumers are increasingly aware of their rights
  • The CRM integration is what turns a WhatsApp chatbot from a novelty into a business system — without it, you're just automating conversations without capturing the value they generate

Lesson Summary

Includes hands-on practice lab6 runnable code examples4-question knowledge check below

Quiz: WhatsApp CRM Integration — HubSpot & Google Sheets

4 questions to test your understanding. Score 60% or higher to pass.