This guide explains how to send data from Customer.io to June using webhooks.
Getting started
We'll head to Customer.io first to set things up. Once you've logged in to your account, follow the steps below to add a new Webhook destination to your data pipeline.
Go to the Data Pipelines tab and click Connections.
Click Add New under Destinations.
Select the Webhooks destination (search "webhook").
(Optional) Select the sources that you want to connect to this destination. You can always connect sources to your destination later.
Give your webhook a name, for example "Webhooks to June".
Next review and enable your destination.
Creating write keys in June
Before we set up our webhooks, let's first create a write key in June that we'll use to send data from Customer.io to June. Navigate to your June account and follow the steps below:
Navigate to Settings from the left navigation
Navigate to June SDK under Data sources
Click on Create new key
Once the key is created click on the 3 dots on the right, and click Rename
Rename the key to "customer.io" so that you can easily remember it
Setting up webhooks
Once you've added your destination, next we'll set up all the webhooks to June. The webhooks we're going to set up are:
Identify
Track
Group
Page
Identify
Let's start with Identify, follow the steps below:
While staying in Data Pipelines, navigate to Destinations
Select the destination you created in the previous step from the list
Select the Actions tab, and click Add Action
Next we'll go through each section on that page.
Action
Don't change this, keep the action to Send
Trigger
Select the trigger to Type is Identify
Data Structure
Set the URL to
https://api.june.so/sdk/identify
Set the HTTP method to
POST
Click on Add Key/Value under HTTP headers
Navigate to June > Settings > June SDK and copy the write key you had created in the previous step
Set the header in the following format:
βAuthorization
=Basic your-write-key
Set the following key mappings in the payload
userId
=$.user.id
anonymousId
=$.anonymousId
traits
=$.traits
timestamp
=$.timestamp
context
=$.context
After finishing the steps above, click on Save Action.
Track
Action
Don't change this, keep the action to Send
Trigger
Select the trigger to Type is Track
Data Structure
Set the URL to
https://api.june.so/sdk/track
Set the HTTP method to
POST
Click on Add Key/Value under HTTP headers
Navigate to June > Settings > June SDK and copy the write key you had created in the previous step
Set the header in the following format:
βAuthorization
=Basic your-write-key
Set the following key mappings in the payload
userId
=$.userId
event
=$.event
properties
=$.properties
anonymousId
=$.anonymousId
timestamp
=$.timestamp
context
=$.context
After finishing the steps above, click on Save Action.
Group
Action
Don't change this, keep the action to Send
Trigger
Select the trigger to Type is Group
Data Structure
Set the URL to
https://api.june.so/sdk/group
Set the HTTP method to
POST
Click on Add Key/Value under HTTP headers
Navigate to June > Settings > June SDK and copy the write key you had created in the previous step
Set the header in the following format:
βAuthorization
=Basic your-write-key
Set the following key mappings in the payload
userId
=$.userId
anonymousId
=$.anonymousId
groupId
=$.groupId
traits
=$.traits
context
=$.context
timestamp
=$.timestamp
After finishing the steps above, click on Save Action.
Page
Action
Don't change this, keep the action to Send
Trigger
Select the trigger to Type is Page
Data Structure
Set the URL to
https://api.june.so/sdk/page
Set the HTTP method to
POST
Click on Add Key/Value under HTTP headers
Navigate to June > Settings > June SDK and copy the write key you had created in the previous step
Set the header in the following format:
βAuthorization
=Basic your-write-key
Set the following key mappings in the payload
properties
=$.properties
userId
=$.userId
anonymousId
=$.anonymousId
timestamp
=$.timestamp
context
=$.context
After finishing the steps above, click on Save Action.
Final steps
Once everything is setup correctly, you'll see the following Actions in Customer.io.
Click on the Tester tab to test if the webhooks are working correctly. Try once for each webhook that you created.
If the webhooks are set up correctly, you'll see the events coming into June. You can verify that by heading into June > Settings > Developer tools.
What's next?
In case you run into any issues with the set up, please reach out to us through the Intercom chat, and we'll be happy to help you π
β