Send events to Klaviyo via RudderStack cloud mode using the old API (v2023-02-22).
6 minute read
After you have successfully instrumented Klaviyo as a destination in RudderStack, follow this guide to correctly send your events to Klaviyo in cloud mode using the old API (v2023-02-22).
The Klaviyo old API (v2023-02-22) will be deprecated soon.
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.
You can send any number of key-value pairs as user traits and RudderStack updates them as custom profile properties in Klaviyo.
To create a new user in Klaviyo, you must pass either the userId, email, or phone properties in the identify call. If a user already exists, RudderStack updates the user profile with the latest values.
Note that specifying consent and smsConsent in the event properties overrides the respective settings specified in the RudderStack dashboard.
Add and subscribe user to list
You can add and subscribe a user to a Klaviyo list by specifying the List ID in the RudderStack dashboard and setting the subscribe option to true. Alternatively, you can add listId within the event properties - this will override the List ID specified in the dashboard for that particular event.
If you have enabled the Double opt-in setting for a list in Klaviyo, users will not be added to the list automatically without their consent. To add users to a list automatically without waiting for their consent, select the Single opt-in option in that list’s settings:
The track call lets you record the user actions along with any properties associated with them.
When sending events to Klaviyo in device mode, you must first identify your users before sending any track events. Klaviyo does not record any anonymous user activity.
In the above snippet, RudderStack captures the information related to the Checked Out event, along with the details of the event.
To associate a user with an event, you need to pass either their userId, email, or phone in the track call. A sample server-side track call along with the user information is as shown:
In the above snippet, RudderStack captures the information related to the Item Purchased event, along with its additional information in properties. Moreover, since this event is captured using a server-side SDK, RudderStack passes the user information in context along with a unique userId.
Note that:
Use context.traits to pass the information in your track or screen events in case you are using a server-side SDK that does not persist user context information.
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 automatically maps it to Klaviyo’s special property $value.
Ecommerce event mapping
RudderStack converts the following ecommerce events to the corresponding Klaviyo events:
RudderStack event
Klaviyo event
Product Viewed Product Clicked
Viewed Product
Product Added
Added to Cart
Checkout Started
Started Checkout
In addition to the above, RudderStack sends the following:
Customer properties: Must contain either the email or phone_number. RudderStack extracts these customer properties from traits/context.traits in the track call.
As mentioned above, you can send any number of key-value pairs as user traits and RudderStack updates them as custom profile properties in Klaviyo.
Token: Public API key from the RudderStack dashboard.
Additionally, you can choose to send specific fields for each of the events covered in the following sections:
Product Viewed
RudderStack maps the Product Viewed event to Viewed Product and maps the following event properties:
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
RudderStack maps the Product Added event to Added to Cart and maps the following event properties:
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 (deprecating soon) products
Items
properties.items will be deprecated soon.
Note that products/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
RudderStack maps the Checkout Started event name to Started Checkout and maps the following event properties:
RudderStack Parameters
Klaviyo Parameters
order_id
$event_id
value
$value
categories
Categories
item_names
ItemNames
items (deprecating soon) products
Items
checkout_url
CheckoutURL
properties.items will be deprecated soon.
Note that products / 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 ecommerce event parameters is shown below:
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.