
Klaviyo
Klaviyo is a data-driven email and SMS marketing platform for targeted advertising campaigns.
Introduction
Klaviyo is a data-driven email and SMS marketing platform for targeted advertising campaigns. By setting up a Data Feed within Klaviyo, you can pull data from any Miso API to use inside email templates.
Integration Steps
Setting up a Klaviyo Data Feed
-
Log into Klaviyo and select Data Feeds from the left navigation pane.
-
Select Add Web Feed. You should see a form to create a new Data Feed.
-
Feed Name - Enter a descriptive name for the specific Miso API you will be using. Feed URL - Enter the URL for calling the Miso API. This is will vary from API to API, but as an example, here’s a URL for the User to Products API:
https://api.askmiso.com/v1/recommendation/user_to_products?api_key={API_KEY}&fl=*&user_id={{#urlEncode}}{{person.id}}{{/urlEncode}}
api.askmiso.com/v1/recommendation/user_to_products
is the base URL of the User to Products API- Replace
{API_KEY}
with your secret API Key (from Dojo). - We’re requesting all fields (
fl=*
) so that we have all our data available to use in the email template. - We need to dynamically set the unique
user_id
for each email recipient so we’ll call theperson.id
field within Klaviyo to get that information.
Request Method - Keep this as GET.
Content Type - Keep this is JSON.
-
Select Add Data Feed.
-
To check if the data is flowing correctly, select Preview in the upper right-hand corner.
Implementing the Data Feed in an email
-
Open up a new or existing email template. If you’re using the classic editor, select Data Feeds in the footer of the editor. Select the Miso Data Feed and Save.
-
Add a Text Block to a new or existing email template.
-
Open the Text Block sub-menu and enable the “repeat a block” functionality. In the Repeat For box, enter
feeds.{NAME_OF_YOUR_DATA_FEED}.data.products
. In the Item Alias box, enteritem
and Save. -
Use dot notation to access any attribute in the
products
array. For example, to access the product title, use{{item.title}}
. The Text Block will repeat for every product in theproducts
array. -
After you’re done editing the email template, you can see what the personalized recommendations will look like using Klaviyo’s preview feature.
Additional Resources
For more information on Miso’s API, check out the official API Documentation.
For more Integrations like this, visit the Integrations page on our Docs site.
Published Date: March 22nd, 2022