Klaviyo
Klaviyo is an sms and email marketing automation platform for e-commerce, which helps grow businesses.
Data integration: Skyvia supports importing data to and from Klaviyo, exporting Klaviyo data to CSV files, replicating Klaviyo data to relational databases, and synchronizing Klaviyo data with other cloud apps and relational databases.
Backup: Skyvia Backup does not support Klaviyo.
Query: Skyvia Query supports Klaviyo.
Establishing Connection
To create a connection with Klaviyo, you need to select the authentication type and specify credentials accordingly.
Getting Credentials
Private API Key — REST API authentication token for connecting to Klaviyo. A private API key is also used for reading data from Klaviyo and manipulating sensitive objects, such as lists. You can manage an API token in the Klaviyo interface. If needed, you can also generate multiple private API keys in your Klaviyo account. Read more about private API keys here.
To get the API Key, perform the following steps:
- Sign in to Klaviyo.
- Click the User icon in the bottom left corner.
- Select Settings on the appeared menu.
- Switch to the API Keys tab and copy your Private API Key.
Creating Private API Key Connection
Enter the obtained API Key in the Connection Editor.
Creating OAuth 2.0 Connection
To connect to Klaviyo via OAuth 2.0, do the following.
-
In the Connection Editor, click Sign In with Klaviyo.
-
Enter your Klaviyo credentials and click Log In.
-
Click Allow to grant Skyvia permission to access your Klaviyo data.
Connector Specifics
Object Peculiarities
Read-only Objects
The following Klaviyo objects are read-only: Accounts, EmailCampaignTags, ImportBulkProfiles, SMSCampaignTags, SegmentProfiles, SegmentTags, ListTags, EventMetrics, EventProfiles, FlowActions, FlowTags, GroupTags.
EmailCampaigns and SMSCampaigns
The CampaignMessages field returns empty results when querying. This field is needed for importing data to these objects.
BulkProfiles
The ProfilesData and Relationships_ListData fields store complex structured data in JSON format. To Import data into these fields, use our Nested Objects mapping feature in the Import integrations. Select the Nested Objects checkbox in Import integration to enable this feature.
You can use this object to insert multiple profiles at once. If you insert the already existing profile, the existing record will be updated.
DailyMetrics, WeeklyMetrics, MonthlyMetrics
The DailyMetrics, WeeklyMetrics, and MonthlyMetrics are the child objects for the Metrics object. We recommend filtering by MetricId when querying data from the DailyMetrics, WeeklyMetrics, and MonthlyMetrics to increase query performance.
Skyvia does not require filtering by the parent object record Id when querying data from a child object. Without filtering by parent record Id, Skyvia first queries all the parent object records, reading each record Id. Then Skyvia looks up child object records to each parent object record Id. This approach allows querying child objects without knowing their parents, but this method consumes time and API calls. It uses at least one API call for every parent object record. Thus, working with these tables may affect performance. We strongly recommend using filters on the parent object fields when querying data from child objects.
DailyMetrics, WeeklyMetrics, MonthlyMetrics store metrics for calendar days, weeks, and months respectively.
when querying data from these tables you can set the date range for data selection. To do this, set filters by Date, WeekStartDate and MonthStartDate fields and =, >, >=, <, <=
operators.
If you don’t use filters by date when querying data from these objects, by default, Klaviyo returns data for one calendar year before today.
If you use the filter by start date only, Klaviyo returns the data for a calendar year from the start date or until today if a year has yet to pass from the start date.
These objects return the data only for the full and already passed calendar days, weeks (Monday till Sunday), and months (1 to 30 (31) days). They do not return data for current days, weeks or months. You can’t select a part of the period, only full period returns in the query result.
If you filter by the date range, which is wider than a full calendar week or month, Klaviyo returns the data only for the full included calendar week or month. If you filter by the date range, which is less than a calendar week or month, Klaviyo returns the empty result.
For example, you perform the following query:
SELECT * FROM MonthlyMetrics WHERE MonthStartDate > '2022-12-25' AND MonthStartDate < '2023-02-05'
This query result will return only the data for the full month included in the selected period (from the 1st to the 31st of January).
Incremental Replication and Synchronization
Skyvia supports Replication with Incremental Updates for such Klaviyo objects as Images, EmailCampaigns, SMSCampaigns, EmailCampaignMessages, SMSCampaignMessages, Lists, Metrics, DailyMetrics, WeeklyMetrics, and MonthlyMetrics.
Incremental Replication tracks only the inserted records for the DailyMetrics, WeeklyMetrics, and MonthlyMetrics objects.
When replicating DailyMetrics, WeeklyMetrics, and MonthlyMetrics, Skyvia pulls data only for the already passed periods. Incremental Replication does not pull data for the current date for DailyMetrics, the current week for WeeklyMetrics, and the current month for MonthlyMetrics.
Skyvia supports Synchronization for EmailCampaigns, SMSCampaigns and Lists.
DML Operations Support
Operation | Object |
---|---|
INSERT, UPDATE, DELETE | CouponCodes, Lists, Templates, CatalogCategories, CatalogVariants, CatalogItems, Tags, TagGroups, EmailCampaigns, SMSCampaigns |
INSERT, UPDATE | Coupons, Images, Profiles |
INSERT | BulkProfiles |
UPDATE | EmailCampaignMessages, SMSCampaignMessages, Flows, Segments |
DELETE | ListProfiles |
Stored Procedures
Skyvia represents part of the supported Klaviyo features as stored procedures. You can call a stored procedure, for example, as a text of the command in the ExecuteCommand action in a Target component of a Data Flow or in Query.
AddListProfiles
The following command inserts records to the ListProfiles object.
call AddListProfiles(:ListId, :PersonId)
CreateEventWithMetricAndProfile
The following command creates new events and associates them with new or existing profile.
call CreateEventWithMetricAndProfile(:metric_name, :properties, :person_id, :email, :phone_number, :first_name, :last_name, :organization, :title, :image, :location_address1, :location_address2, :location_city, :location_country, :location_latitude, :location_longitude, :location_region, :location_zip, :location_timezone, :location_ip, :properties_person, :append, :unappend, :unset, :metric_service, :time, :value)
PARAMETER NAME | DESCRIPTION |
---|---|
Metric_name | The associated metric for the event |
Properties | Properties of the new event in format, for example {"Color": "Grey","Tovar": "TV-1506"} |
Person_id | Profile unique identifier, if you associate this event with the existing one |
Email of the profile for which the event is being created | |
Phone_number | Phone number of the profile for which the event is being created. You can omit this parameter if the required profile has no phone number |
First_name | Individual’s first name |
Last_name | Individual’s last name |
Organization | Name of the company or organization within the company for whom the individual works |
Title | Individual’s job title |
Image | URL pointing to the location of a profile image |
Location_address1 | First line of street address |
Location_address2 | Second line of street address |
Location_city | City name |
Location_country | Country name |
Location_latitude | Latitude coordinate. Precision of four decimal places is recommended |
Location_longitude | Longitude coordinate. Precision of four decimal places is recommended |
Location_region | Region within a country, such as state or province |
Location_zip | Zip code |
Location_timezone | Time zone name. We recommend using time zones from the IANA Time Zone Database |
Location_ip | IP Address |
Properties_person | Custom profile properties |
Append | Append a simple value or values to this property array |
Unappend | Remove a simple value or values from this property array |
Unset | Remove a key or keys (and their values) completely from properties |
Metric_service | This is for advanced usage. For api requests, this should use the default, which is set to API |
Time | Event date and time |
Value | A numeric value to associate with this event. For example, the dollar amount of a purchase |
CreateEvent
The following command adds new event for specific existing profile.
call CreateEvent(:email,:phone_number,:metric,:properties,:time,:value)
PARAMETER NAME | DESCRIPTION |
---|---|
Email of the profile for which the event is being created. Optional in case when the Phone is specified. | |
Phone_number | Phone number of the profile for which the event is being created. Optional if the Email is specified. |
Metric | The associated metric for the event |
Properties | Properties of the new event in format, for example {"Color": "Grey","Tovar": "TV-1506"} |
Value | A numeric value to associate with this event. For example, the dollar amount of a purchase |
SuppressProfiles
To change the profile status to suppressed, use the command
call SuppressProfiles(:SuppressionEmail)
PARAMETER NAME | DESCRIPTION |
---|---|
SuppressionEmail | The list of emails for suppression in the following format [{"type":"profile","attributes":{"email":"[email protected]"}}] |
UnsuppressProfiles
To change the profile status to unsuppressed, use the command
call UnsuppressProfiles(:SuppressionEmail)
PARAMETER NAME | DESCRIPTION |
---|---|
SuppressionEmail | The list of emails for suppression in the following format [{"type":"profile","attributes":{"email":"[email protected]"}}] |
Supported Actions
Skyvia supports all the common actions for Klaviyo.