Skip to main content
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.
1

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
2

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
3

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.
4

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

If you also want to track specific events in Customer.io, you can create an additional Action:
This is implemented using the Customer.io Pipelines API.
  1. Create another Action named “Track Event in Customer.io”
  2. Add this code:
If your Customer.io account is in the EU region, use https://cdp-eu.customer.io/v1/track as the endpoint instead.
  1. Add a Trigger for when you want to track an event
    • Example: WHEN Button KEY submit_button IS Clicked
    • Select your “Track Event in Customer.io” Action

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.