Systematize data mapping
Prior to building out a custom integration or custom solution, it is imperative to know what data you are going to send in and out of Klaviyo and how to structure that data.
Read on for a flexible 4-step framework that helps you work backward from your end goal to identify and properly structure all of your data.
Identify the end goal and requirements
The first step is to define a clear goal. What are you looking to do in Klaviyo? Are you looking to send a message? Add key profile information? Import historical actions that took place? Be as specific as possible here.
Once you have your end goal, come up with the objects that are required to make this happen. For instance, if your end goal is to send an email to recent purchasers to tell them shipments are delayed, you will need an email template for that email and you'll need to identify the audience to send to.
What data do you have access to?
Take an assessment of what data already exists in Klaviyo and what additional data you need to send to Klaviyo to achieve your goal.
Taking stock of your data can help clarify the best way to ingest or export the data of interest.
For instance, after determining that your end goal is to email purchasers whose shipments are delayed, you may note that shipment delay information is maintained in your 3rd party shipping software, while order data and customer data is automatically synced to Klaviyo.
How should the required objects be structured?
This section will take the most careful planning and consideration. This is where you will take the data you have and the data you want and determine the best way to structure each data object. As you work through this section, you may identify some additional data you need.
A good strategy here is to start with the required data objects you identified in step 1. Go through each one in detail and decide on the exact format of each object and how it should be structured so that all of the required information makes it to the right place.
In our example, you will need to determine what data you need to set up your email template and segment. The shipping data you will use to create your segment will need to be top-level (not nested) so that you can use it in the segment builder.
Identify the correct endpoint(s)
Once the structure and data objects have been described, the last step is to identify the correct API endpoints to use. Klaviyo's API reference documentation is organized by data object. Use this documentation to identify the correct endpoint. You can also implement our web and mobile SDKs to make the correct API calls, and you may wish to use SFTP or CSV import to get the appropriate data into Klaviyo.
To send shipping data into Klaviyo, you can need to upload historic shipping data via SFTP import, then use Create Event to capture shipping events going forward.
Then, you are all set to make the appropriate API calls and set up your custom solution!
See this framework in action
In the following examples, we'll walk through how to apply this data mapping framework to some real life use cases.