Overview
This guide will show two methods of displaying dynamic content in Klaviyo emails using Octane AI's Klaviyo integration.
If you haven't already, learn how to connect Klaviyo here.
What you'll learn
What you need to set up the right type of flow for inserting quiz data & products into emails.
Prerequisites
The steps in this article requires a custom event only created in Octane Plus quizzes.
You'll also need Klaviyo connected and at least 1 test opt-in from an Octane AI quiz present in Klaviyo.
How does it work?
1. A customer takes you quiz and submits an email opt-in through the quiz.
2. The customer's profile syncs to Klaviyo automatically.
3. After syncing, a timeline event appears in their profile indicating quiz completion.
This timeline event shows up every time a customer takes your quiz and submits an opt-in. If a customer has never opted in through an Octane AI quiz before, their quiz data won't be able to be associated with their email profile.
This quiz completion event will include:
Quiz questions & answers (through custom properties)
Products recommended
By using the right flow & code in Klaviyo, you can use this data to filter and personalize emails.
Step 1: Setting up the right flow in Klaviyo
In order to use the special data-filled timeline event to customize flows, first you'll have to create a flow triggered by this event.
This is done by choosing the Metric option for a flow's trigger setup.
Before creating the flow, make sure to register your Klaviyo data at least once using this method. Without this step, the event won't be an option for the flow until it has shown up in Klaviyo at least once time.
Setting up a Metric-triggered flow
1. Create a new flow in Klaviyo from scratch.
2. On the trigger select screen, pick Metric.
3. For the metric, search "quiz completed".
4. Select your quiz's "quiz completed" event. This flow will only be able to pull in data from the event chosen here.
5. Click "Done" to finalize the trigger and create the flow.
Step 2: Previewing your data
Emails must be previewed inside of the metric-triggered flow in order to see dynamic changes work.
Additionally, previewing inside of the flow will let you grab any piece of code you need to represent a particular piece of quiz data.
1. Add an email into your quiz's metric-triggered flow. This can be a new email or an existing template.
2. Inside of the flow, open the email in Klaviyo's editor. This can be done in Klaviyo's new or classic editor.
3. In the classic editor, click the Preview button on the left.
4. In the new editor, click Preview and test in the top right.
5. While previewing, click on any piece of data to copy the code needed to show it in an email.
Step 3: Trying out a dynamic variable
With the correct flow type created, how are the emails themselves created? This is done by inserting code into emails that the email will replace with content whenever the timeline event appears in an email profile.
Try adding the variable below into a button or text box in your email:
Quiz completed results page URL variable | {{ event|lookup:'Result Page URL'|default:'' }} |
When you preview this email, that code will turn into a link to the results page linked in the quiz session you're previewing with.
The method above will only work in a metric-triggered flow.
To add the URL to other types of flows, insert the quiz results page URL custom property using the "Personalization" option in Klaviyo's content editor.
Custom properties can be used in any type of flow, but only metric-triggered flows can enter customers every time the trigger is met.
In a list-triggered flow, customers will only be able to enter them once.
Step 4: Creating a dynamic table
Using the process outlined in step 2, you can grab and insert the variable for any piece of data such as the product image, its price or a link to its product page.
But, this method requires you to predict exactly how many products will appear each time. If your email template is formatted to show 3 products, but only 2 appear, the email will feature a blank spot instead.
Instead, you can create a dynamic table which requires making only 1 block that repeats for each product shown in your quiz.
Jump to our step-by-step guide to creating a dynamic block below.