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:

  1. Select Klaviyo from the list of providers.
  2. Select the Klaviyo API Key method for authorization.
  3. In the Label text box, enter a name for the authorization
  4. (optional) In the Description text box, enter a description for this authorization
  5. In the Private API Key password box, enter your Private API Key credential.
  6. Click Save Authorization.

Klaviyo 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:

  1. Select Klaviyo from the list of providers.
  2. Select the Klaviyo Sign-In method for authorization.
  3. Enter your Klaviyo login credentials in the login popup and confirm the authorization.
  4. In the Label text box, enter a name for the authorization.
  5. (optional) In the Description text box, enter a description for this authorization.
  6. 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:

  1. 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}.
  2. 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.
  3. After a backfill, the job will receive real-time updates when a user enters or exits the audience.
  4. 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.
  5. 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 FieldDescriptionKlaviyo FieldType
emailEmail AddressEmailstring

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.

  1. Select Klaviyo from the list of providers.
  2. Select the Export Audiences job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job you are creating in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. Select the audiences to export.
  7. Complete the configuration steps for your job.
  8. (Optional) From the List input, select an existing list to export to. If no list is selected, a new list will be created.
  9. (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.
  10. From the Email Field input, select the field that contains the user emails.
  11. (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.
  12. (Optional) Select the Force Add 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.
  13. Click Start Export.

Klaviyo Export

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:

  1. Iterate through all the selected lists and for each:
    1. 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.
  2. 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 FieldLytics User FieldDescriptionType
$address1address_1Address Line 1string
$address2address_2Address Line 2string
$citycityCitystring
$countrycountryCountrystring
$first\_namefirst_nameFirst Namestring
$last\_namelast_nameLast Namestring
$latitudelatitudeLatitudenumber
$longitudelongitudeLongitudenumber
$organizationorganizationOrganizationstring
$phone\_numberphonePhone Numberstring
$regionregionState/Provincestring
$timezonetimezoneTimezonestring
$zipzipZipstring
email($email)email unique idEmail Addressstring
idka_profile_id unique idKlaviyo Profile Idstring
set($title)titleTitle[]string
set(campaign_ids)ka_campaign_idsKlaviyo Campaign Ids[]string
set(list_ids)ka_list_idsKlaviyo Lists[]string
todate(updated)ka_user_updatedKlaviyo Profile Updateddate

The following fields are included in the default mapping of the klaviyo_activity stream:

Source FieldLytics User FieldDescriptionType
Client Namemail_clientMail Clientstring
Client OS Familymail_client_os_familyMail Client Operating System Familystring
Client OSmail_client_osMail Client Operating Systemstring
Client Typemail_client_typeMail Client Typestring
Email Domainemail_domainEmail Domainstring
count(event_name)ka_clickctKlaviyo Click Countint
count(event_name)ka_openctKlaviyo Opened Email Countint
count(event_name)ka_recievedctKlaviyo Recieved Email Countint
count(event_name)ka_unsubctKlaviyo Unsubscribe Countint
email(email)email unique idEmail Addressstring
epochms()ka_recieved_tsKlaviyo Recieved Email Timedate
epochms()ka_unsub_tsKlaviyo Unsubscribe Timedate
event_nameka_email_eventKlaviyo Email Eventstring
max(epochms())ka_lastclick_tsKlaviyo Last Email Clickdate
max(epochms())ka_lastopen_tsKlaviyo Last Opened Emaildate
min(epochms())ka_firstclick_tsKlaviyo First Email Clickdate
min(epochms())ka_firstopen_tsKlaviyo First Opened Emaildate
profile_idka_profile_id unique idKlaviyo Profile Idstring
set(Subject)ka_email_subjectKlaviyo Email Subject[]string
set(URL)ka_email_urlKlaviyo Campaign URL[]string
set(Campaign Name)ka_campaign_nameKlaviyo Campaign Name[]string
set(campaign_id)ka_campaign_idsKlaviyo Campaign Ids[]string
valuect(event_name)ka_email_eventctKlaviyo Email Event Countmap[string]intsum
valuect(hash(urlmain(URL)))hashedurlsHashed Urls Visitedmap[string]intsum
valuect(hourofday())ka_hourlyclickKlaviyo Email Clicks By Hourmap[string]intsum
valuect(hourofday())ka_hourlyopenKlaviyo Opened Emails By Hourmap[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.

  1. Select Klaviyo from the list of providers.
  2. Select the Import Users and Activity Data job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job you are creating in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. Complete the configuration steps for your job.
    Klaviyo import work config
  7. 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.
  8. (Optional) Select the Skip importing Klaviyo activity data checkbox to skip importing Klaviyo activity.
  9. (Optional) Select the Skip importing Klaviyo user profiles checkbox to skip importing Klaviyo users.
  10. (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.
  11. (Optional) Select the Keep Updated checkbox to continuously import data.
  12. Click Start Import.
  13. 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.