LogoLogo
  • Contributing to RudderStack
  • Destination_Name
  • LICENSE
  • RudderStack Docs
  • docs
    • FAQ
    • Identity Resolution
    • Home
    • cloud-extract-sources
      • ActiveCampaign Source
      • Bing Ads
      • Chargebee
      • Common Settings
      • Facebook Ads
      • Freshdesk
      • Google Ads Source
      • Google Analytics
      • Google Search Console
      • Google Sheets
      • Cloud Extract Sources
      • Intercom v2
      • Intercom
      • Mailchimp
      • Marketo
      • Mixpanel
      • NetSuite
      • Pipedrive
      • QuickBooks
      • Salesforce Pardot
      • Sendgrid Source
      • Stripe Source
      • Xero
      • Zendesk Chat
      • Zendesk
      • hubspot
        • HubSpot Data Model and Schema Information
        • HubSpot
      • salesforce
        • Salesforce
        • Schema Comparison: RudderStack vs. Segment
    • connections
      • Connection Modes: Cloud Mode vs. Device Mode
    • data-governance
      • Data Governance
      • RudderTyper
      • Data Governance API
      • RudderTyper
      • tracking-plans
        • Tracking Plans
        • Tracking Plan Spreadsheet
    • data-warehouse-integrations
      • Amazon Redshift
      • Azure Data Lake
      • Azure Synapse
      • ClickHouse
      • Databricks Delta Lake
      • Google Cloud Storage Data Lake
      • Google BigQuery
      • Identity Resolution
      • Warehouse Destinations
      • Microsoft SQL Server
      • PostgreSQL
      • Amazon S3 Data Lake
      • Snowflake
      • FAQ
      • Warehouse Schema
    • destinations
      • Destinations
      • Webhooks
      • advertising
        • Bing Ads
        • Criteo
        • DCM Floodlight
        • Facebook App Events
        • Facebook Custom Audience
        • Facebook Pixel
        • Google Ads (gtag.js)
        • Google AdWords Enhanced Conversions
        • Google Adwords Remarketing Lists (Customer Match)
        • Advertising
        • LinkedIn Insight Tag
        • Lotame
        • Pinterest Tag
        • Reddit Pixel
        • Snap Pixel
        • TikTok Ads
      • analytics
        • Amplitude
        • AWS Personalize
        • Chartbeat
        • Firebase
        • FullStory
        • Google Analytics 360
        • Google Analytics
        • Heap.io
        • Hotjar
        • Analytics
        • Indicative
        • Keen
        • Kissmetrics
        • Kubit
        • Lytics
        • Mixpanel
        • Pendo
        • PostHog
        • Quantum Metric
        • Singular
        • adobe-analytics
          • Adobe Analytics Heartbeat Measurement
          • Mobile Device Mode Settings
          • Web Device Mode Settings
          • E-commerce Events
          • Adobe Analytics
          • Setting Up Adobe Analytics in RudderStack
        • google-analytics-4
          • Cloud Mode
          • Device Mode
          • Google Analytics 4
          • Setting up Google Analytics 4
        • profitwell
          • ProfitWell
          • Cloud Mode
          • Device Mode
      • attribution
        • Adjust
        • AppsFlyer
        • Branch
        • Attribution
        • Kochava
        • TVSquared
      • business-messaging
        • Business Messaging
        • Intercom
        • Kustomer
        • Slack
        • Trengo
      • continuous-integration
        • Visual Studio App Center
        • Continuous Integration
      • crm
        • Delighted
        • HubSpot
        • CRM
        • Salesforce
        • Variance
        • Zendesk
      • customer-data-platform
        • Customer Data Platform
        • Segment
      • error-reporting
        • Bugsnag
        • Error Reporting
        • Sentry
      • marketing
        • ActiveCampaign
        • AdRoll
        • Airship
        • Appcues
        • Autopilot
        • Blueshift
        • Braze
        • CleverTap
        • Customer.io
        • Gainsight PX
        • Gainsight
        • Marketing
        • Iterable
        • Klaviyo
        • Leanplum
        • Mailchimp
        • Marketo Lead Import
        • Marketo
        • MoEngage
        • Ometria
        • Pardot
        • Post Affiliate Pro
        • Qualtrics
        • SendGrid
        • Salesforce Marketing Cloud
        • Userlist
        • drip
          • Cloud Mode
          • Device Mode
          • Drip
          • Setting Up Drip in RudderStack
      • productivity
        • Google Sheets
        • Productivity
      • storage-platforms
        • Amazon S3
        • DigitalOcean Spaces
        • Google Cloud Storage
        • Storage Platforms
        • Azure Blob Storage
        • MinIO
        • Redis
      • streaming-platforms
        • Amazon EventBridge
        • Amazon Kinesis Firehose
        • Amazon Kinesis
        • Azure Event Hubs
        • BigQuery Stream
        • Confluent Cloud
        • Google Pub/Sub
        • Streaming Platforms
        • Apache Kafka
      • tag-managers
        • Google Tag Manager
        • Tag Managers
      • testing-and-personalization
        • Algolia Insights
        • Candu
        • Google Optimize
        • A/B Testing & Personalization
        • LaunchDarkly
        • Monetate
        • Optimizely Full Stack
        • Optimizely Web
        • Split.io
        • Statsig
        • VWO (Visual Website Optimizer)
    • get-started
      • RudderStack Cloud vs. RudderStack Open Source
      • Glossary
      • Get Started
      • RudderStack Architecture
    • reverse-etl
      • Amazon Redshift
      • Amazon S3
      • ClickHouse
      • FAQ
      • Google BigQuery
      • Reverse ETL
      • PostgreSQL
      • Snowflake
      • common-settings
        • Importing Data using Models
        • Importing Data using Tables
        • Common Settings
        • Sync Modes
        • Sync Schedule
      • features
        • Airflow Provider
        • Features
        • Models
        • Visual Data Mapper
    • rudderstack-api
      • Data Regulation API
      • HTTP API
      • RudderStack API
      • Personal Access Tokens
      • Pixel API
      • Test API
      • api-specification
        • Application Lifecycle Events Specification
        • API Specification
        • Video Events Specification
        • rudderstack-ecommerce-events-specification
          • Browsing
          • Coupons
          • E-Commerce Events Specification
          • Ordering
          • Promotions
          • Reviewing
          • Sharing
          • Wishlist
        • rudderstack-spec
          • Alias
          • Common Fields
          • Group
          • Identify
          • RudderStack Event Specification
          • Page
          • Screen
          • Track
    • rudderstack-cloud
      • Audit Logs
      • Dashboard Overview
      • Destinations
      • RudderStack Cloud
      • Live Events
      • Connection Modes: Cloud Mode vs. Device Mode
      • Sources
      • Teammates (User Management)
      • connections
        • Adding a Destination
        • Connections
    • rudderstack-open-source
      • Control Plane Setup
      • RudderStack Open Source
      • installing-and-setting-up-rudderstack
        • Developer Machine Setup
        • Docker
        • Data Plane Setup
        • Kubernetes
        • Sending Test Events
    • stream-sources
      • App Center
      • AppsFlyer
      • Auth0
      • Braze
      • Customer.io
      • Extole
      • Event Stream Sources
      • Iterable
      • Looker
      • PostHog
      • Segment
      • Shopify
      • Webhook Source
      • rudderstack-sdk-integration-guides
        • Client-side Event Filtering
        • SDKs
        • AMP Analytics
        • Cordova
        • .NET
        • Go
        • Java
        • Node.js
        • PHP
        • Python
        • React Native
        • Ruby
        • Rust
        • Unity
        • SDK FAQs
        • rudderstack-android-sdk
          • Adding Application Class
          • Flushing Events Periodically
          • Android
        • rudderstack-flutter-sdk
          • Flutter SDK v1
          • Flutter v2
          • Flutter
        • rudderstack-ios-sdk
          • iOS
          • tvOS
          • watchOS
        • rudderstack-javascript-sdk
          • Data Storage in Cookies
          • Detecting Ad-blocked Pages
          • JavaScript
          • JavaScript SDK Enhancements
          • JavaScript SDK FAQs
          • Querystring API
          • Quick Start Guide
          • Version Migration Guide
          • consent-managers
            • Consent Managers
            • OneTrust
    • transformations
      • Access Token
      • FAQ
      • Transformations
      • Transformations API
    • user-guides
      • User Guides
      • administrators-guide
        • Troubleshooting Guide
        • Alerting Guide
        • Bucket Configuration Settings for Event Backups
        • Configuration Parameters
        • Event Replay
        • High Availability
        • Horizontal Scaling
        • Administrator's Guides
        • Infrastructure Provisioning
        • Monitoring and Metrics
        • Okta SSO Setup
        • OneLogin SSO Setup
        • RudderStack Grafana Dashboard
        • Software Releases
      • how-to-guides
        • How to Use Custom Domains
        • How to Develop Integrations for RudderStack
        • How to Configure a Destination via the Event Payload
        • How to Filter Events using Different Methods
        • How to Filter Selective Destinations
        • How to Submit a Pull Request for a New Integration
        • How-to Guides
        • How to Debug Live Destination Events
        • How to Use AWS Lambda Functions with RudderStack
        • create-a-new-destination-transformer-for-rudder
          • Best Practices for Coding Transformation Functions in JavaScript
          • How to Create a New Destination Transformation for RudderStack
        • implement-native-js-sdk-integration
          • How to Add a Device Mode SDK to RudderStack JavaScript SDK
          • How to Implement a Native JavaScript SDK Integration
        • rudderstack-jamstack-integration
          • How to Integrate RudderStack with Your JAMstack Site
          • How to Integrate Rudderstack with Your Angular App
          • How to Integrate Rudderstack with Your Astro Site
          • How to Integrate Rudderstack with Your Eleventy Site
          • How to Integrate Rudderstack with Your Ember.js App
          • How to Integrate Rudderstack with a Gatsby Website
          • How to Integrate Rudderstack with a Hugo Site
          • How to Integrate Rudderstack with Your Jekyll Site
          • How to Integrate Rudderstack with Your Next.js App
          • How to Integrate Rudderstack with Your Nuxt.js App
          • How to Integrate Rudderstack with Your Svelte App
          • How to Integrate Rudderstack with Your Vue App
      • migration-guides
        • Migrating from Blendo to RudderStack
        • Migrating Your Warehouse Destination from Segment to RudderStack
        • Migration Guides
        • Migrating from Segment to RudderStack
  • src
    • @rocketseat
      • gatsby-theme-docs
        • text
          • Home
Powered by GitBook
On this page
  • Getting started
  • Connection settings
  • Page
  • Screen
  • Track
  • E-Commerce event name mapping
  • Identify
  • Adding a user to a list
  • Group
  • Contact us

Was this helpful?

  1. docs
  2. destinations
  3. marketing

Klaviyo

Step-by-step guide to send your event data from RudderStack to Klaviyo.

PreviousIterableNextLeanplum

Last updated 3 years ago

Was this helpful?

is a powerful eCommerce platform that lets you boost your business revenue. It supports unique features such as category-based segmentation and various event triggers based on page views, purchases, email engagement, etc. You can easily track and measure all your user activity and the resulting revenue and get a breakdown of this revenue based on different custom attributes.

Klaviyo also offers features such as trend reports, cohort analysis, and various options for boosting customer engagement, such as personalized newsletters, product recommendations, in-app push notifications, and more.

RudderStack supports Klaviyo as a destination to which you can seamlessly send your event data.

Find the open-source transformer code for this destination in our .

Getting started

Before configuring Klaviyo as a destination in RudderStack, verify if the source platform is supported by Klaviyo by referring to the table below:

Connection Mode

Web

Mobile

Server

Device mode

Supported

-

-

Cloud mode

Supported

Supported

Supported

To know more about the difference between cloud mode and device mode in RudderStack, refer to the guide.

Once you have confirmed that the source platform supports sending events to Klaviyo, follow these steps:

  • From your , add the source. Then, from the list of destinations, select Klaviyo.

Connection settings

To successfully configure Klaviyo as a destination, you will need to configure the following settings:

  • Public API Key: Your Public API Key is the unique key generated against your Klaviyo account. It can be found in your Klaviyo dashboard in the Account section under Settings.

  • Private API Key: Your Private API key can be generated for your account in the Account section under Settings. This key allows you to add users to a list or subscribe them using personalised emails/SMS.

  • Enforce Email as Primary Identifier: If this option is enabled, RudderStack will never set $id field to your userId when you send the events. Instead, RudderStack will only set a custom attribute _id and $email as the primary identifier with your traits.email or properties.email.

This setting should be enabled only if you are experiencing any issues with duplicate profiles created in your Klaviyo account.

  • List Id: Enter your default list ID to which you want to add or subscribe your identified users.

  • Consent: If you are a GDPR-compliant business, you will need to include consent in your API call.

consent is a Klaviyo-specific property and only accepts these values: email, web, sms, directmail, and mobile.

  • SMS Consent: If you are updating the consent for a phone number, or would like to send an opt-in SMS to the profile (for double opt-in lists), then enable this option. Alternatively, you can also include an smsConsent key in the properties with a value of true or false.

  • Send Page As Track: Enable this option if you wish send page events as track events along with the event name and category.

  • Additional Page info: If you are sending page events as track events, you can also choose to send in additional properties for the event by enabling this field.

  • Use Native SDK to send Events: Enable this option if you want to send events using the web device mode.

In case userId is absent, RudderStack uses anonymousId for mapping the user with an unique identifier. In case both userId and anonymousId are absent, then email or phone will be considered as the user's primary identifier.

Page

The page call lets you record your website's page views with any additional relevant information about the viewed page.

You can send the name and category information in the page event by enabling the Send Page As Track while setting up the Klaviyo destination in RudderStack. To associate the properties with the page view event, enable the Additional Page info setting.

A sample page call is shown below:

rudderanalytics.page("Cart", "Cart Viewed", {
  path: "/cart",
  referrer: "test.com",
  search: "term",
  title: "test_item",
  url: "http://test.in",
})

Screen

The screen method lets you record whenever the user views their mobile screen, with any additional relevant information about the screen.

The screencall is the mobile equivalent of the page call.

A sample screen call is shown below:

[[RSClient sharedInstance] screen:@"Sample Screen Name" properties:@{@"prop_key" : @"prop_value"}];

In the above snippet, RudderStack captures all the information related to the viewed screen along with any additional information associated with the event. In the destination, the above screen call will be shown as Sample Screen Name: along with the properties.

Track

The track call allows you to capture user actions along with the properties associated with these actions.

Each user action is called as an event.

The user has to be associated with an event either via their userId, email, or phone.

A sample track call is shown below:

rudderanalytics.track("Checked Out", {
  Clicked_Rush_delivery_Button: true,
  total_value: 2000,
  Ordered: ["T-Shirt", "jacket"],
  revenue: 2000,
})

In the above snippet, RudderStack captures the information related to the Checked Out event, along with the details of the event.

A sample server-side track call along with the user information is as shown:

client.track({
  userId: "user2",
  event: "Item Purchased",
  properties: {
    revenue: 97.5,
    products: [
      {
        productId: "pro1",
        price: 32.5,
        quantity: 3,
      },
    ],
  },
  context: {
    traits: {
      email: "user2@gmail.com",
    },
  },
})

In the above snippet, RudderStack captures the information related to the Item Purchased event, along with any additional info about that event in properties - in this case the revenue, along with product information. Moreover since this event is captured using a server-side SDK, RudderStack passes the user information in context, along with a unique userId.

  • To send track or screen type event using an SDK that does not persist user context information after identify, you need to pass the information in context.traits.

  • To set a specific value to the screen or track type event, you need to pass the event-related property in the properties field. Also, you can send revenue property in the track event and RudderStack will automatically map it to Klaviyo's special property $value.

E-Commerce event name mapping

E-Commerce event name mapping is supported for both RudderStack cloud mode and web device mode.

RudderStack converts the following E-Commerce event names to the corresponding Klaviyo event names, before sending the events to Klaviyo:

RudderStack Event Name

Klaviyo Event Name

product viewed/product clicked

Viewed Product

product added

Added to Cart

checkout started

Started Checkout

In addition, RudderStack also sends the associated customer properties and the token.

The token refers to the Public API key used to configure Klaviyo as a destination in RudderStack. This is a mandatory field.

The customer properties must contain atleast one of email or phone_number.

In addition to the above-mentioned properties, you can also optionally send specific fields for each of the events covered in the following sections.

Product Viewed

As mentioned in the table above, RudderStack converts the Product Viewed event name to Viewed Product. The event properties are also mapped to the Klaviyo properties, as shown:

RudderStack Property

Klaviyo Property

name

ProductName

product_id

ProductID

sku

SKU

image_url

ImageURL

url

URL

brand

Brand

price

Price

compare_at_price

CompareAtPrice

categories

Categories

Product Added

As mentioned previously, RudderStack converts the Product Added event name to Added to Cart. The event properties are also mapped to the Klaviyo properties, as shown:

RudderStack Property

Klaviyo Property

value

$value

name

AddedItemProductName

product_id

AddedItemProductID

sku

AddedItemSKU

image_url

AddedItemImageURL

url

AddedItemURL

price

AddedItemPrice

quantity

AddedItemQuantity

categories

AddedItemCategories

item_names

ItemNames

checkout_url

CheckoutURL

items

Items

Furthermore, items can contain the following parameters:

RudderStack Parameters

Klaviyo Parameters

product_id

ProductID

sku

SKU

name

ProductName

quantity

Quantity

price

Price

total

RowTotal

url

URL

image_url

ImageURL

categories

ProductCategories

Checkout Started

As mentioned previously, RudderStack converts the Checkout Started event name to Started Checkout. The event properties are also mapped to the Klaviyo properties, as shown:

RudderStack Parameters

Klaviyo Parameters

order_id

$event_id

value

$value

categories

Categories

item_names

ItemNames

items

Items

checkout_url

CheckoutURL

Furthermore, items can contain the following parameters:

RudderStack Parameters

Klaviyo Parameters

product_id

ProductID

sku

SKU

name

ProductName

quantity

Quantity

price

Price

total

RowTotal

url

URL

image_url

ImageURL

categories

ProductCategories

A sample track call containing the above e-Commerce event parameters is shown below:

rudderanalytics.track("checkout started ", {
  order_id: "1234",
  value: 12.34,
  categories: ["category1", "category2"],
  checkout_url: "http://www.testcall.com",
  item_names: ["item1", "item2"],
  items: [{
      product_id: "pId1",
      sku: "sku1",
      name: "item1",
      url: "https://www.item1URL.com",
      price: 1.0,
      quantity: 1,
      image_url: "https://www.item1Image.com,
      categories: ["category1", "category2"],
      row_total: 1.0
    },
    {
      product_id: "pId2",
      sku: "sku2",
      name: "item2",
      url: "https://www.item2URL.com",
      price: 2.0,
      quantity: 1,
      image_url: "https://www.item2Image.com,
      categories: ["category1", "category2"],
      row_total: 2.0
    },
  ],
});

When sending events via the web device mode, specifying order_id is not mandatory, as Klaviyo automatically assigns the timestamp to the event. However, if explicitly specified, it must be unique. Klaviyo automatically discards the events with a duplicate order_id.

Identify

The identify call lets you identify a visiting user and associate them to their actions. It also lets you record the traits about them like their name, email address, etc.

A sample identify call is shown below:

rudderanalytics.identify("userid", {
  firstName: "Name",
  lastName: "Surname",
  email: "name@website.com",
  phone: "+12 345 678 900",
  userId: "userId",
  title: "Owner",
  organization: "Company",
  city: "Tokyo",
  region: "ABC",
  country: "JP",
  zip: "100-0001",
  Flagged: false,
  Residence: "Shibuya",
  properties: {
    listId: "XUepkK",
    subscribe: true,
    consent: "email",
    smsConsent: true,
  },
})

In the above snippet, RudderStack captures the user-related information like the email, phone, as well as the associated traits of the user.

To map a user in Klaviyo, you need either the userId, email, or phone. If a user already exists, the new values will be updated for that user.

Adding a user to a list

You can add a user to a Klaviyo list if the List ID is specified in the RudderStack dashboard. Alternatively, you can add listId within the event properties.

Doing so will override the List ID specified in the dashboard for that particular event. Similarly, specifying consent and smsConsent in the event properties will override the respective settings specified in the RudderStack dashboard for the specific event.

You can also subscribe the user to a list by setting subscribe option to true.

Group

The group call lets you link an identified user with a group, such as a company, organization, or an account. It also lets you record any custom traits associated with that group, such as the name of the company, the number of employees, etc.

A sample server-side group call looks like the following:

client.group({
  userId: "userId",
  groupId: "listId",
  traits: {
    subscribe: true,
  },
  context: {
    traits: {
      email: "user.test@gmail.com",
      city: "city",
      country: "country",
      zip: "213456",
      age: 23,
      plan: "free",
      consent: "email",
      phone: "1-617-555-1333",
      smsConsent: true,
    },
  },
})

In the above snippet, the user with the associated traits is added to list, and also subscribed using the subscribe flag.

Apart from userId, email, or phone, the other fields are not mandatory.

Adding consent and smsConsent property in the user traits will override the settings specified in the RudderStack dashboard for the specific event.

Contact us

The page calls are only supported in the RudderStack device mode. For more information on the RudderStack device mode, refer to the guide.

The screen calls are only supported in the RudderStack cloud mode. To know more about the RudderStack cloud mode, refer to the guide.

RudderStack extracts the customer properties from traits/context.traits. Refer to the sample track call in the section above for more information on passing the properties within traits/context.traits.

Adding or subscribing users to a specific list is only available in cloud mode integration. To know more about the RudderStack cloud mode, read the guide.

Adding or subscribing users to a specific list via the group event is only available in cloud mode integration. To know more about the RudderStack cloud mode, read the guide.

For queries on any of the sections covered in this guide, you can or start a conversation in our community.

RudderStack Connection Modes
RudderStack Connection Modes
Track
RudderStack connection modes
RudderStack connection modes
contact us
Slack
Klaviyo
GitHub repo
RudderStack Connection Modes
RudderStack dashboard
Klaviyo connection settings