Klaviyo
Overview
Klaviyo is an email marketing platform created for online businesses — featuring powerful email and SMS marketing automation.
Integrating Lytics with Klaviyo allows you to import user profiles and email campaign activity data (such as opens and clicks). You can also export users based on audience membership in real-time for use in email campaigns.
Authorization
If you haven't already done so, you will need to set up a Klaviyo account before you begin the process described below. If you are new to creating authorizations in Lytics, see the Authorizations documentation for more information.
There are two ways you can connect Lytics and Klaviyo:
- Klaviyo API Key
- Klaviyo OAuth Sign-In
Klaviyo API Key
You would need Klaviyo private api key in order to use this authorization. Please refer to Klaviyo documentation on how to generate a private api key.
Follow the steps below to add this authorization in Lytics:
- Select Klaviyo from the list of providers.
- Select the Klaviyo API Key method for authorization.
- In the Label text box, enter a name for the authorization
- (optional) In the Description text box, enter a description for this authorization
- In the Private API Key password box, enter your Private API Key credential.
- Click Save Authorization.
Klaviyo OAuth Sign-In
When you select this authorization type, a Klaviyo login pop-up window will be visible. Once you log in, you will be redirected to the consent dashboard. Please allow the Lytics app access to the various scopes required for the import and export jobs.
Please refer to Klaviyo OAuth documentation for more information on how OAuth works with Klaviyo.
When adding authorization via OAuth. You will see a pop up window that says "App has not been reviewed". Please proceed as Lytics is in the process of being verified by Klaviyo.
Follow the steps below to add this authorization in Lytics:
- Select Klaviyo from the list of providers.
- Select the Klaviyo Sign-In method for authorization.
- Enter your Klaviyo login credentials in the login popup and confirm the authorization.
- In the Label text box, enter a name for the authorization.
- (optional) In the Description text box, enter a description for this authorization.
- Click Save Authorization.
Export Audiences
Exporting Lytics audiences to Klaviyo allows you to enhance your Klaviyo user base with new users or update existing users with cross-channel data from Lytics.
Integration Details
- Implementation Type: Server-side Integration.
- Implementation Technique: REST API Integration - Audience Trigger Integration
- Frequency: Real-time Integration with an optional one-time Backfill of the audience after job setup.
- Resulting data: Lytics users that are members of the selected audiences are exported to Klaviyo and added to the selected list. Lytics users can be exported to an existing list or a new list. Only known users (with an email) are exported.
This integration utilizes the Klaviyo API to send users to a list in Klaviyo. Once the export is started, the job will:
- Check if an existing list was selected. If not, create a new list with the name provided in the configuration. If no name is provided, create a new list with the name format
Lytics {Date}
. - Run a backfill by creating or updating existing users in Klaviyo. Users will be subscribed to a list by default. Otherwise, users are force added to a list.
- After a backfill, the job will receive real-time updates when a user enters or exits the audience.
- For each user entering the selected audience(s), the job will create or update the user in Klaviyo and by default subcribe the user or force add the user to the Klaviyo list. Only known users with valid email identifiers are included in the export.
- For each user exiting the selected audience(s), the job will remove the user from the selected list.
Larger audiences may take a few days to be completely added to a list due to Klaviyo API limitations.
Fields
By default, Lytics exports the following fields to Klaviyo:
Lytics User Field | Description | Klaviyo Field | Type |
---|---|---|---|
Email Address | string |
In addition to the default fields, you can export a number of Lytics user fields to Klaviyo fields. Lytics allows you to map user profile fields with the corresponding Klaviyo field as part of the job configuration.
Configuration
Follow these steps to set up and configure an export job for Klaviyo in the Lytics platform. If you are new to creating jobs in Lytics, see the Destinations documentation for more information.
- Select Klaviyo from the list of providers.
- Select the Export Audiences job type from the list.
- Select the Authorization you would like to use or create a new one.
- Enter a Label to identify this job you are creating in Lytics.
- (Optional) Enter a Description for further context on your job.
- Select the audiences to export.
- Complete the configuration steps for your job.
- (Optional) From the List input, select an existing list to export to. If no list is selected, a new list will be created.
- (Optional) In the New List Name text box, enter a new list name to export to. If no list name is entered, a new list will be created with the name format
Lytics {Date}
. NOTE: A selected list name will take priority over creating a list with a new name. - From the Email Field input, select the field that contains the user emails.
- From the Phone Number Field input, select the field that contains the user phone numbers.
- (Optional) From the Map Fields input, map all the fields from Lytics to Klaviyo by selecting the Lytics field on the left, and its Klaviyo destination on the right.
- (Optional) Select the Historical Load checkbox to state that this is a historical load. In order to send historical opt-in status, the consent date field must be set below and the date must be present on the user to be added.
- (Optional) From the Email Marketing Consent input, select email marketing consent for users in the exported audience. Different consent groups should be sent through separate jobs to the same list.
- (Optional) From the Email Marketing Consent Date Field input, select the field that has the date that the user consented to email marketing for this list.
- (Optional) From the SMS Marketing Consent input, select SMS marketing consent for users in the exported audience. Different consent groups should be sent through separate jobs to the same list.
- (Optional) From the SMS Marketing Consent Date Field input, select the field that has the date that the user consented to SMS marketing for this list.
- (Optional) Select the Use Add to List instead of Subscribe to List checkbox to force add profiles to a list. This will ignore a list's opt-in settings. Otherwise, profiles will be single or double opted into the list in accordance with that list’s settings.
- Click Complete to start a new job.
Users will be available in the Klaviyo list within a few minutes of starting the export. Larger audiences may take a few days to be completely added to the list. You can find the new list in Klaviyo under Lists & Segments.
Import Users & Activity
Importing user and activity data from Klaviyo results in new users or existing user profiles supplemented with Klaviyo data. You can use this data to build and refine your existing Lytics audiences to power better, cross-channel campaigns.
Integration Details
- Implementation Type: Server-side Integration.
- Implementation Technique: REST API Integration.
- Frequency: Batch Integration every hour.
- Resulting data: User Profiles and Raw Event Data.
This integration utilizes Klaviyo APIs to import user and campaign data. Once the import is started, the job will:
- Iterate through all the selected lists and for each:
- Get the lists's members and if the member's profile has been updated since the last import, the member's profile is passed to
klaviyo_users
data stream.
- Get the lists's members and if the member's profile has been updated since the last import, the member's profile is passed to
- For all the selected lists, get the activity metric data since the last import. Activity metrics are passed to
klaviyo_activity
stream.
Fields
The following fields are included in the default mapping of the klaviyo_users
stream. If you want to import custom user fields from Klaviyo, please contact your Lytics account manager.
Source Field | Lytics User Field | Description | Type |
---|---|---|---|
$address1 | address_1 | Address Line 1 | string |
$address2 | address_2 | Address Line 2 | string |
$city | city | City | string |
$country | country | Country | string |
$first\_name | first_name | First Name | string |
$last\_name | last_name | Last Name | string |
$latitude | latitude | Latitude | number |
$longitude | longitude | Longitude | number |
$organization | organization | Organization | string |
$phone\_number | phone | Phone Number | string |
$region | region | State/Province | string |
$timezone | timezone | Timezone | string |
$zip | zip | Zip | string |
email($email ) | email unique id | Email Address | string |
id | ka_profile_id unique id | Klaviyo Profile Id | string |
set($title ) | title | Title | []string |
set(campaign_ids) | ka_campaign_ids | Klaviyo Campaign Ids | []string |
set(list_ids) | ka_list_ids | Klaviyo Lists | []string |
todate(updated) | ka_user_updated | Klaviyo Profile Updated | date |
The following fields are included in the default mapping of the klaviyo_activity
stream:
Source Field | Lytics User Field | Description | Type |
---|---|---|---|
Client Name | mail_client | Mail Client | string |
Client OS Family | mail_client_os_family | Mail Client Operating System Family | string |
Client OS | mail_client_os | Mail Client Operating System | string |
Client Type | mail_client_type | Mail Client Type | string |
Email Domain | email_domain | Email Domain | string |
count(event_name) | ka_clickct | Klaviyo Click Count | int |
count(event_name) | ka_openct | Klaviyo Opened Email Count | int |
count(event_name) | ka_recievedct | Klaviyo Recieved Email Count | int |
count(event_name) | ka_unsubct | Klaviyo Unsubscribe Count | int |
email(email) | email unique id | Email Address | string |
epochms() | ka_recieved_ts | Klaviyo Recieved Email Time | date |
epochms() | ka_unsub_ts | Klaviyo Unsubscribe Time | date |
event_name | ka_email_event | Klaviyo Email Event | string |
max(epochms()) | ka_lastclick_ts | Klaviyo Last Email Click | date |
max(epochms()) | ka_lastopen_ts | Klaviyo Last Opened Email | date |
min(epochms()) | ka_firstclick_ts | Klaviyo First Email Click | date |
min(epochms()) | ka_firstopen_ts | Klaviyo First Opened Email | date |
profile_id | ka_profile_id unique id | Klaviyo Profile Id | string |
set(Subject) | ka_email_subject | Klaviyo Email Subject | []string |
set(URL) | ka_email_url | Klaviyo Campaign URL | []string |
set(Campaign Name ) | ka_campaign_name | Klaviyo Campaign Name | []string |
set(campaign_id) | ka_campaign_ids | Klaviyo Campaign Ids | []string |
valuect(event_name) | ka_email_eventct | Klaviyo Email Event Count | map[string]intsum |
valuect(hash(urlmain(URL))) | hashedurls | Hashed Urls Visited | map[string]intsum |
valuect(hourofday()) | ka_hourlyclick | Klaviyo Email Clicks By Hour | map[string]intsum |
valuect(hourofday()) | ka_hourlyopen | Klaviyo Opened Emails By Hour | map[string]intsum |
Configuration
Follow these steps to set up and configure an import job for Klaviyo in the Lytics platform. If you are new to creating jobs in Lytics, see the Data Sources documentation for more information.
- Select Klaviyo from the list of providers.
- Select the Import Users and Activity Data job type from the list.
- Select the Authorization you would like to use or create a new one.
- Enter a Label to identify this job you are creating in Lytics.
- (Optional) Enter a Description for further context on your job.
- Complete the configuration steps for your job.
- From the Lists to Import input, select lists to import. Lists available to be imported from Klaviyo are located in the left column. Campaigns added to the right column will be imported to Lytics.
- (Optional) Select the Skip importing Klaviyo activity data checkbox to skip importing Klaviyo activity.
- (Optional) Select the Skip importing Klaviyo user profiles checkbox to skip importing Klaviyo users.
- (Optional) In the Start Date text box, enter the date to start importing Klaviyo user and activity data. Please use the format
yyyy-mm-dd
, e.g.2021-01-25
. - (Optional) Select the Keep Updated checkbox to continuously import data.
- Click Start Import.
- Navigate to the Schema dashboard within Conductor and publish the required changes for the Klaviyo integration to surface these new fields into the Customer Profile.
Updated 2 months ago