Importing old data into Customer.io
Once you’ve had a chance to see Customer.io work, the next thing you might want to do is back-fill your historical data. Here are a couple of options.
1. Advanced: Write a script
If you’re a developer, you may want to write a quick script to loop through all of the people in your database and add them to Customer.io. While this creates a lot of API requests, it’s fine to do and won’t overload our system if you follow the API guidelines.
2. Easier: Send us a CSV file
After you’ve upgraded your account, you may need some time to set up your API integration. In this case, for new accounts, you can send a CSV file to us (email it to email@example.com). We’ll run a script for you in order to import your data.
There are a few things you should make sure of before sending us your data:
We’ll need to know how everyone on your list signed up
Please send that explanation along with your file. Any URLs where people signed up or an explanation of how the signup worked is great. Please also let us know when everyone was last contacted or how long ago they signed up.
People should have unique IDs
Each person in Customer.io is identified by a unique ID. “id” (lowercase) should be the first column in your CSV file. Most often this is the same ID that you use in your database. IDs cannot be changed later.
If you have a mix of people with and without IDs in your database you can standardize on the email address as an ID. However, when people change their email address in your system, this can cause duplicate accounts in customer.io.
People should have timestamps
Ideally every person added has a timestamp of when you first began your relationship with them. We look for a “created_at” attribute by default and that’s used in our default “Signed up” segment and welcome campaigns. You can reconfigure those, but we recommend having an attribute to identify that original sign up time. This should be in unix format (seconds since the epoch).
You can optionally set the “unsubscribed” attribute
If someone doesn’t want email from you, you can still add them. Just set “unsubscribed” equal to TRUE and we’ll unsubscribe them from mail in Customer.io. It’s optional to pass this information over in an import. Learn more about unsubscribes.
Advanced: Backfilling Events
You can optionally add historical event data by adding a timestamp.
If you want to also use the event timestamp to customize your emails, you can add an additional attribute to the data hash like this:
If you need help on any of these issues, please get in touch.