How To: Send data to Customer.io
Setting up an Action with custom code that sends user data to Customer.io’s API
The best way to send data to Customer.io is using custom code in an Action, that is Triggered when a user takes an action, such as entering their email or completing a purchase.
Sending User Data to Customer.io
This is implemented using the Customer.io Pipelines API.
Set up Customer.io HTTP Source
- Go to Customer.io and navigate to the Sources tab
- Click “Add Source”
- Select “HTTP” and click “Next”
- Give the source a name and copy your API Key
Create a custom code Action
- Go to the Logic sidebar and click on the Actions tab
- Click
+ Add New Action
- Give it a descriptive name (e.g. “Identify User in Customer.io”)
- Hit
Add
Write your custom code
Add the following code to your Action:
If your Customer.io account is in the EU region, use https://cdp-eu.customer.io/v1/track
as the endpoint instead.
Add a Trigger for your Action
- Switch to the Triggers tab
- Add a new Trigger
- Choose when to identify/update the user
- Example:
WHEN Page KEY user_info_page IS Completed
- Select your “Identify User in Customer.io” Action
- Hit
Add
Optional: Tracking Events in Customer.io
Learn more about Custom Code
Read more about writing Custom Code in Embeddables, including all the available arguments passed in to the function.
Learn more about Customer.io's APIs
Read more about Customer.io’s APIs, including detailed information about available endpoints and data formats.
Was this page helpful?