Integrasi CS Otomatis WA dengan CRM

Integrasi CS Otomatis WA dengan CRM
Integrasi CS Otomatis WA dengan CRM

Chat di WA, data di CRM = Terpisah!

Integrasi WA + CRM membuat semua data customer tersentralisasi dan actionable.


Kenapa Perlu Integrasi?

TANPA Integrasi:
- Chat di WA, tidak tercatat
- History terpisah
- Tidak tahu customer journey
- Manual input ke CRM

DENGAN Integrasi:
- Semua chat tercatat di CRM
- 360° customer view
- Automated data sync
- Better insights

Apa yang Bisa Di-integrate?

1. Contact Sync

WA Contact → CRM Contact
- Nama
- Nomor telepon
- Profile info
- Tags/labels

2. Conversation Logging

Setiap chat → Log di CRM
- Timestamp
- Message content
- Bot/Human response
- Resolution status

3. Customer Data Enrichment

CRM → WA Bot
- Order history
- Preferences
- Membership tier
- Previous tickets

4. Automated Workflows

Trigger di WA → Action di CRM
- New inquiry → Create lead
- Komplain → Create ticket
- Order → Update pipeline

HubSpot:

javascript

const hubspot = require('@hubspot/api-client');
const hubspotClient = new hubspot.Client({ accessToken: 'YOUR_TOKEN' });

// Create or update contact
async function syncToHubspot(contact) {
    const properties = {
        phone: contact.phone,
        firstname: contact.firstName,
        lastname: contact.lastName,
        wa_last_chat: new Date().toISOString(),
        wa_chat_count: contact.chatCount
    };
    
    try {
        await hubspotClient.crm.contacts.basicApi.create({
            properties
        });
    } catch (e) {
        // If exists, update
        await hubspotClient.crm.contacts.basicApi.update(
            contact.hubspotId,
            { properties }
        );
    }
}

// Log conversation
async function logConversation(contactId, message) {
    await hubspotClient.crm.objects.notes.basicApi.create({
        properties: {
            hs_note_body: `WhatsApp: ${message}`,
            hs_timestamp: Date.now()
        },
        associations: [{
            to: { id: contactId },
            types: [{ associationCategory: 'HUBSPOT_DEFINED', associationTypeId: 202 }]
        }]
    });
}

Salesforce:

javascript

const jsforce = require('jsforce');
const conn = new jsforce.Connection({ loginUrl: 'https://login.salesforce.com' });

async function syncToSalesforce(contact) {
    await conn.login(username, password);
    
    // Upsert contact
    await conn.sobject('Contact').upsert({
        Phone: contact.phone,
        FirstName: contact.firstName,
        LastName: contact.lastName,
        WhatsApp_Last_Chat__c: new Date()
    }, 'Phone');
}

// Create case for complaint
async function createCase(contact, complaint) {
    const result = await conn.sobject('Case').create({
        ContactId: contact.salesforceId,
        Subject: `WhatsApp Complaint: ${complaint.subject}`,
        Description: complaint.message,
        Origin: 'WhatsApp',
        Status: 'New'
    });
    
    return result.id;
}

Zoho CRM:

javascript

const axios = require('axios');

async function syncToZoho(contact) {
    await axios.post('https://www.zohoapis.com/crm/v2/Contacts', {
        data: [{
            Phone: contact.phone,
            First_Name: contact.firstName,
            Last_Name: contact.lastName,
            WhatsApp_Active: true
        }]
    }, {
        headers: { 'Authorization': `Zoho-oauthtoken ${token}` }
    });
}

Integration Architecture

┌─────────────────┐     ┌─────────────────┐
│   WhatsApp      │     │      CRM        │
│   (via Bot)     │     │ (HubSpot/SF)    │
└────────┬────────┘     └────────┬────────┘
         │                       │
         │    ┌─────────────┐   │
         └───►│ Integration │◄──┘
              │   Layer     │
              │ (Webhook/   │
              │   API)      │
              └─────────────┘
                    │
              ┌─────▼─────┐
              │  Actions: │
              │ • Sync    │
              │ • Log     │
              │ • Trigger │
              └───────────┘

Real-time Sync Flow

javascript

// Bot receives message
client.on('message', async msg => {
    const contact = await getOrCreateContact(msg.from);
    
    // 1. Log incoming message to CRM
    await crmClient.logActivity({
        contactId: contact.crmId,
        type: 'whatsapp_incoming',
        content: msg.body,
        timestamp: new Date()
    });
    
    // 2. Process with bot
    const response = await processMessage(msg, contact);
    
    // 3. Send response
    await msg.reply(response);
    
    // 4. Log outgoing message
    await crmClient.logActivity({
        contactId: contact.crmId,
        type: 'whatsapp_outgoing',
        content: response,
        timestamp: new Date()
    });
    
    // 5. Update contact last activity
    await crmClient.updateContact(contact.crmId, {
        lastWhatsAppActivity: new Date()
    });
});

Use Case: Lead Scoring

javascript

// Update lead score based on WA activity
async function updateLeadScore(contactId, activity) {
    const scores = {
        'replied_to_promo': 10,
        'asked_price': 20,
        'asked_how_to_order': 30,
        'submitted_order': 50
    };
    
    const score = scores[activity] || 5;
    
    await crmClient.updateContact(contactId, {
        leadScore: { $inc: score }
    });
}

Use Case: Automated Pipeline

javascript

// Move deal through pipeline based on WA
async function updatePipeline(customerId, action) {
    const deal = await crmClient.getDealByCustomer(customerId);
    
    const stageMap = {
        'inquiry': 'Qualified',
        'price_discussion': 'Proposal',
        'order_placed': 'Negotiation',
        'payment_confirmed': 'Closed Won'
    };
    
    if (stageMap[action]) {
        await crmClient.updateDeal(deal.id, {
            stage: stageMap[action]
        });
    }
}

Best Practices

1. Real-time > Batch

✅ Sync immediately when chat happens
❌ Batch sync daily (data stale)

2. Bi-directional Sync

WA → CRM (chat logs)
CRM → WA (customer data untuk personalisasi)

3. Error Handling

javascript

async function syncWithRetry(fn, maxRetries = 3) {
    for (let i = 0; i < maxRetries; i++) {
        try {
            return await fn();
        } catch (error) {
            if (i === maxRetries - 1) throw error;
            await sleep(1000 * Math.pow(2, i)); // Exponential backoff
        }
    }
}

4. Data Mapping

Standardize data format:
- Phone: International format (628xxx)
- Dates: ISO format
- Names: First/Last separated

Simple Integration (No CRM)

Google Sheets sebagai "CRM":

javascript

const { GoogleSpreadsheet } = require('google-spreadsheet');

async function logToSheets(contact, message) {
    const doc = new GoogleSpreadsheet(SHEET_ID);
    await doc.useServiceAccountAuth(creds);
    await doc.loadInfo();
    
    const sheet = doc.sheetsByIndex[0];
    await sheet.addRow({
        timestamp: new Date().toISOString(),
        phone: contact.phone,
        name: contact.name,
        message: message,
        status: 'new'
    });
}

FAQ

CRM mana yang paling mudah di-integrate?

HubSpot paling developer-friendly dengan API yang bagus. Zoho dan Pipedrive juga relatif mudah.

Perlu developer untuk integrasi?

Untuk full integration, ya. Tapi beberapa platform (Balaswa, dll) sudah punya built-in integration.

Bagaimana dengan GDPR/privasi?

Pastikan data handling comply dengan regulasi. Inform customer bahwa data di-record.


Kesimpulan

WA + CRM = Complete customer view!

BenefitImpact
Centralized dataNo more silos
Chat historyContext for CS
Automated workflowsEfficiency
Better insightsData-driven decisions

Connect your WA to CRM!

Setup CRM Integration →


Artikel Terkait