|

|  How to Integrate Google Dialogflow with Intercom

How to Integrate Google Dialogflow with Intercom

January 24, 2025

Learn to seamlessly integrate Google Dialogflow with Intercom for enhanced customer interactions. Boost your support and engage more effectively.

How to Connect Google Dialogflow to Intercom: a Simple Guide

 

Prerequisites

 

  • Ensure you have a Google Cloud Platform account with Dialogflow enabled.
  •  

  • Create a Dialogflow agent and set up intents and entities according to your needs.
  •  

  • Ensure you have an Intercom account and access to the Intercom developer hub.

 

Configuring Dialogflow

 

  • Go to the Dialogflow console and navigate to the Integrations tab.
  •  

  • Enable the Webhook integration within your Dialogflow agent settings. This allows Dialogflow to send information to external URLs.
  •  

  • Create a custom Webhook URL using a cloud function or a server endpoint to handle Dialogflow’s requests.

 

Creating a Webhook

 

  • Set up a server using Node.js, Python, or any preferred language to handle incoming Dialogflow webhook requests.
  •  

  • Ensure your server can parse JSON requests and respond with JSON formatted responses.
  •  

  • Example Node.js server setup:
  •  

    const express = require('express');
    const bodyParser = require('body-parser');
    
    const app = express();
    app.use(bodyParser.json());
    
    app.post('/webhook', (req, res) => {
        const intent = req.body.queryResult.intent.displayName;
        let response = { fulfillmentText: "Default response" };
        
        if (intent === 'YourIntentName') {
            response.fulfillmentText = "Custom response for intent";
        }
    
        res.json(response);
    });
    
    app.listen(process.env.PORT || 3000, () => {
        console.log('Server is running');
    });
    

 

Connect Webhook to Dialogflow

 

  • In the Dialogflow console, navigate to Fulfillment, enable Webhook, and input your server’s webhook URL.
  •  

  • Ensure that your server is publicly accessible and using HTTPS for secure communication.

 

Setting Up Intercom

 

  • Log in to your Intercom account and navigate to the Developer Hub.
  •  

  • Create a new app and note down the app ID and app secret, which will be used to authenticate your integration.
  •  

  • Enable the "Incoming" and "Outgoing" Webhooks in Intercom if needed, for further customization and interaction.

 

Integrating with Intercom

 

  • In your server handling the Dialogflow webhook, implement a function to send messages to Intercom using their API.
  •  

  • Use the Intercom Node.js library or directly make HTTP requests to Intercom's API.
  •  

  • Example Intercom API call:
  •  

    const axios = require('axios');
    
    function sendMessageToIntercom(userId, message) {
        return axios.post(`https://api.intercom.io/messages`, {
            message_type: "inapp",
            body: message,
            from: { type: "user", user_id: userId }
        }, {
            headers: {
                'Authorization': `Bearer YOUR_ACCESS_TOKEN`,
                'Accept': 'application/json',
                'Content-Type': 'application/json'
            }
        });
    }
    

 

Testing the Integration

 

  • Interact with your Dialogflow agent through Intercom chat, ensuring intents trigger correctly and responses are sent back effectively.
  •  

  • Monitor both systems for logs and errors to ensure the webhook is functioning correctly and sending necessary data between systems.

 

Finalizing and Deploying

 

  • Confirm that your server is stable and can handle scaling based on expected traffic.
  •  

  • Deploy your server solution to a robust cloud service to ensure maximum uptime for your Dialogflow-Intercom integration.

 

Omi Necklace

The #1 Open Source AI necklace: Experiment with how you capture and manage conversations.

Build and test with your own Omi.

How to Use Google Dialogflow with Intercom: Usecases

 

Integrating Google Dialogflow with Intercom for Enhanced Customer Support

 

  • Objective Verification:  Integrating Google Dialogflow with Intercom can automate customer interactions, reduce response times, and enhance the customer support experience.
  •  

  • Seamless Conversation Flow:  By connecting Dialogflow's natural language processing capabilities with Intercom's chat platform, customers can interact with automated agents. This helps ensure that common queries are handled promptly, enabling human agents to focus on complex issues.
  •  

  • Get Started with Google Dialogflow:  Create a Dialogflow project to define intents and entities that capture a wide range of customer interactions.
  •  

  • Link Dialogflow to Intercom:  Use the Intercom API to connect Dialogflow. Set up webhooks to allow Dialogflow to process and respond to Intercom conversations automatically.
  •  

 

{
  "webhookUrl": "https://yourserver.com/dialogflow-webhook",
  "languageCode": "en"
}

 

  • Custom Responses:  Program custom responses in Dialogflow for typical customer inquiries, allowing quick resolutions to frequently asked questions.
  •  

  • Fallback Intent Handling:  Implement fallback intents in Dialogflow to ensure that if an inquiry cannot be handled automatically, it is seamlessly transferred to a human agent in Intercom.
  •  

  • Data Collection & Analysis:  Use analytics to measure interaction success rates. Adjust conversation design and agent responses to improve overall performance.
  •  

  • Continuous Learning:  Update intent and entity definitions based on new common inquiries and conversation patterns, improving the AI's coverage over time.

 

 

Streamlining Customer Feedback with Google Dialogflow and Intercom

 

  • Enhancing Feedback Collection:  By leveraging Google Dialogflow and Intercom, companies can automate the process of gathering customer feedback in real-time, allowing for more immediate insights and actionable data.
  •  

  • Automated Survey Deployment:  Utilize Dialogflow's intent recognition to trigger surveys based on specific customer interactions, ensuring feedback is timely and relevant.
  •  

  • Building the Dialogflow Agent:  Set up a Dialogflow agent that can understand and collect various types of feedback, such as satisfaction ratings or suggestions for improvement.
  •  

  • Connecting Dialogflow with Intercom:  Integrate Dialogflow with Intercom using API calls to allow customers to submit feedback directly through the chat interface seamlessly.
  •  

 

{
  "feedbackTrigger": "intent",
  "surveyUrl": "https://yourserver.com/dialogflow-survey"
}

 

  • Understanding User Sentiment:  Implement sentiment analysis within Dialogflow to categorize feedback as positive, neutral, or negative, allowing for tailored follow-up actions.
  •  

  • Escalation of Negative Feedback:  Automatically route negative feedback to a human support representative in Intercom to address the issues more effectively and personally.
  •  

  • Data-Driven Insights:  Analyze collected feedback to identify trends or common issues that can inform product development and improve customer satisfaction.
  •  

  • Continuous Improvement:  Use the feedback data to refine Dialogflow intents and responses, ensuring a more effective interaction over time as customer needs evolve.

 

Omi App

Fully Open-Source AI wearable app: build and use reminders, meeting summaries, task suggestions and more. All in one simple app.

Github →

OMI NECKLACE + OMI APP
First & only open-source AI wearable platform

a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded