Intercom Webhook Setup Guide
This article describes how to set up the Intercom webhook.
Prerequisites
Before implementing this connector in Customer Data Hub it is strongly advised that you read and test the sections that are applicable to your business.
Authorization
Intercom adopts two authorisation methods; Access Tokens and OAuth. The following server-side integration with the Customer Data Hub uses an Access Token.
Configuring Intercom Access Token
When you create your token, it is likey you will need to extend its scope to leverage the request types for your business’ needs. You can request this extension by asking the Intercom team.
To create your token:
Customer Data Hub Configuration
Setting up your stream(s)
Skip this section if you are familiar with setting up streams.
It is best practice to always set up streams for your individual use cases or needs, unless you are sending all data to a vendor. This will allow you more granular control over the connections, as well as the ability to alter them in the future without affecting other requests. Having multiple streams and actions will increase maintenance, but may save complications down the line.
To do this:
- Log in to Tealium Customer Data Hub
- Navigate to Live Events under the Discover tab.
- Click + Add Stream and Filter by Event Attribute.
- Add a Title.
- Add the appropriate condition rules, depending on your variables and Data Layer.
Setting up a Webhook
For this example, I am going to create a Webhook that will pass a new user event. Intercom’s API documentation on this type of request can be found here.
To build a custom webhook:
- Log in to Tealium Customer Data Hub
- Navigate to Connector Marketplace under the Act tab.
- Search for and select Webhook
- Click Add Connector.
- Enter a title.
- Leave the BasicAuth fields blank.
- Navigate to the Actions tab.
- Select the Send Custom Request Action and click + Create Action.
- Enter an Action Name.
- Choose the source of your data (stream).
- Enter your API URL (check Intercom documentation, Users is
https://api.intercom.io/users
). - Leave the URL Parameters section blank.
- Add two Headers, both with custom fields, one with
Map: applications/json To: Accept
and another withMap: {{auth_template}} To: Authorization.
The authorization mapping uses a template, which we will configure later. Make sure you put within{{}}
. - Leave Cookies section blank.
- Select application/json in Body Content Type.
- Within the Body Data section, add a template mapping to Body. Make sure you put within {{}}.
- Within the Template Variables section, add the mappings of your event level attributes to template endpoints. Make sure you select Event Attributes in this section if you are a AudienceStream customer as this is an EventStream setup. Leave names in the “To:” fields without
{{}}
- Under Templates add two templates, one for the Authorization and one for the Body. Use the exact same names as created in previous sections. In the Authorization template add the Access Token you generated in Intercom after Bearer. For the Body template, follow Intercom documentation along with Trimou Template Engine Guide. Make sure you use "" as its use changes depending on variable type (integers, strings, et cetera). You will have to nest your Template Variables mapped in previous step within
{{}}
as a minimum.
- Save Action and Webhook
- Save/Publish your profile.
- Test the Webhook using Trace.
With everything configured you can now test the setup with Trace.
If successful, you will see a successful Action Processed message in Trace and the data within Intercom.
If unsuccessful, follow the errors on the Intercom Webhook connector in the My Connectors section under the Act tab. Also, testing with Postman at this stage with your exact webhook configuration. Ensure that you replace the mappings with actual values.
This page was last updated: January 23, 2020