Send an Automated Message to Intercom’s Chat Widget
Colin Nederkoorn on Mar 3, 2020
Intercom is a popular live chat tool that lets your users talk in real-time to a customer support representative – frequently, companies will also use Intercom for in-app notifications. Using Intercom’s API and Customer.io’s Webhook Action, you can trigger automated messages to specific users through the Intercom live chat widget.
An “App” created in Intercom’s developer hub for internal use. You’ll need the Access token from the “Authentication” screen
Ideally, your users in Intercom and Customer.io will be identified with the same id.
Our Campaign
We’re going to create a campaign in Customer.io with two workflow items. First, we’re going to look up a user in Intercom, grab their intercom ID then store it as an attribute on their Customer.io Profile. Second, we’re going to send a message to that person in Intercom using that ID.
This request uses the ID from Customer.io to look up a person in Intercom. Note that we’re restricting it to “user” roles, and not looking at “lead” roles.
Use the response to set the “intercom_user” attribute in Customer.io.
Set intercom_user to:
{{response.data[0].id}}
You can use “send test” to see if the API request works before moving on. We won’t set the attribute during the test.
You’ll want to change the “From” id to a user in your Intercom account, and again you need your token from your Intercom developer account to replace the xxxxxx next to “Bearer”
That’s it! Once again, you can “Send Test” and if you have a value for {{ customer.intercom_user }} the message will appear in their profile in Intercom and be shown to the user next time they log in.
This is just the tip of the iceberg for how you might use Customer.io with Intercom’s API, but hopefully gives you a useful first step.
Keep in mind, you could also have two separate campaigns in order to grab intercom IDs for all new users in case you want to send them a message later.