Sending quiz results to your Klaviyo account
You can set up your customer's quiz results to be sent to your Klaviyo account.
Caution: To continue you'll need to be familiar with custom variables and email flows in Klaviyo.
Before you begin
You need to ensure you have successfully integrated Klaviyo with your Shopify store. Learn more about integrating Klaviyo with your Quiz Kit app.
Note: This integration feature is available for the Basic plan or higher.
You also need to add the custom properties provided below to your Klaviyo setup.
Creating your flow:
From your Klaviyo dashboard, click Flows.
Click Create Flow.
Click Build your own.
Name your flow and click Create Flow.
Under Select a trigger, click the Your Metrics tab, then click API.
Choose the event that should trigger your flow. Click Quiz Completed to trigger the email to be sent when the customer completes your quiz.
Click Save, then Confirm and save.
Drag and drop the Email action into the flow.
In the right-hand menu, enter your email details and choose a template.
You need to use custom properties to use dynamic data from your quiz results pages.
You have access to the following variables: "Result title", "Result subtitle", "Result description", "Discount code" and "Products". Read this doc to see how to use these variables.
Below is an example of code for showing the "Result title": {{ person | lookup: 'Result title' | default: '' }} - you can set default value inside of '' if needed.
Click to expand
Showing your products using dynamic blocks
Learn how to use dynamic table blocks to add product and other event information to your metric-triggered flows.
Within a metric-triggered flow, you can personalize the content of your emails based on the event that triggers the flow. The dynamic table block will automatically repeat with the information specified for each item.
Before you begin
Before you can jump in, make sure that you have event data to use. Navigate to Analytics > Metrics to make sure the event exists in Klaviyo.
It's also helpful to understand data types in Klaviyo, particularly lists (i.e., arrays). An array is a way to store multiple pieces of data that are structured the same way.
For example, a customer’s Quiz results products are stored as an array within a Quiz Completed event. The items array contains one entry per item ordered, and each entry contains the details for that item (e.g., item title, image, link, quantity, size, color, etc.).
Step 1: Add a dynamic table
Click the email block you added to your flow in the last section.
Click Configure Content.
Choose Drag and Drop.
Choose a template to use as your base.
Drag a table block into your email.
Click Table Settings > Dynamic to convert the table into a dynamic block. You’ll see 2 fields appear: Row Collection and Row alias; we’ll complete those fields in the next steps.
Click back to the Content tab to adjust your column types.
In this example your product image will be on the left and details about the product on the right. Click on the left or right row selector, then click Text or Image to change the cell type.
Step 2: Identify your row collection
In this step, you'll add the name of the array you plan to iterate over to the Row collection field. To find the name of your array: the appropriate setting for the Row collection field is event.Products
Step 3: Choose a row alias
Your row alias can be any text you’d like to use (with no special characters or spaces). You’ll use this alias within your dynamic table block to identify variables that should be pulled from the array you selected above. It’s helpful to choose a simple but descriptive alias, so it’s easy to remember.
In this example, the dynamic table block repeats over a list, so item is a good alias to use.
Once you’ve filled out the Row Collection and Row Alias fields on Table Settings > Dynamic, you’re ready to start building your table.
Step 4: Add dynamic product details
After the data source is set up, you can use tags to add text in your email. Since this email is for sending Quiz results, it’s important to show the name of the product left behind, along with other details like a price and link to purchase.
To input the product title in your block:
Navigate to one of the table's columns. If you want an image in the first column and the text in the second, click on the column selector on the right of the block’s Content section.
Add
{{ item.title }}
.Preview the email to ensure that the title shows up. If it doesn’t appear, double-check the spelling, capitalization, and formatting of the text, as well as your settings in the Table Settings tab, to ensure there are no errors.
Repeat the same steps to add in additional item details: item.price, item.link, item.image
Hyperlinking a product title
To add a hyperlink to the product title:
Find the product URL variable in your event details.
Simply add {{ item.link }}).
Highlight the full variable for the item’s title (e.g.,
{{ item.title }}
).Click the link icon and paste your URL variable into the URL field.
hyperlink_product_title.gif
Step 5: Add an image
To insert a dynamic image, find the event variable for the image in the preview modal. Name of the variable is: {{ item.image }}
. This is an event variable, which holds the images for this specific item.
Once you have this variable, head to the column where you want to display the image (the left column, in this case).
Click Image under Cell content if it’s currently set to Text.
Click Add Dynamic Image / Browse Image.
In the Dynamic Image tab, paste your image variable into the Dynamic variable or dynamic URL field.
Input the customized image event variable,
{{ item.image }}
.Click Save.
Add the product URL variable from step five in the Link address field so the image is clickable.
Set a max width for the image, starting with 250-300 and adjusting as needed.
Once you finish making changes, click Done and preview your email to make sure it appears as expected. If an image doesn’t appear, check the spelling of the variable against the one in the preview modal.
Step 6: Preview your email
After completing the steps above, the email template should look similar to the one below.
Dynamic_block_preview.jpg
To see how this would look with dynamic content, and to make sure the links work properly, click Preview and test. If there are any errors, check the spelling and structure of your variables, as well as your Table Settings tab.
You can use these same concepts to build out additional dynamic blocks for flows triggered based on different metrics.
Summary
As a recap, follow these steps to build a dynamic table block in your flow email:
Create a metric-triggered flow.
Add a table block and set it to Dynamic.
Use the preview modal to identify your Row collection.
Choose a Row alias.
Add dynamic product details by adjusting the variables.
Add a dynamic image.
Preview.
Showing your products using custom code
To go loop through the products and display the right data, you need to use the "for" cycle: {% for product in person.Products %}{{ product.title }} - {{ product. price }}{% endfor %} In each product you can display: 1) product.title 2) product.price 3) product.link 4) product.image 5) product.id When your email template is ready publish your email flow live and all new quiz customers that will subscribe will receive a beautiful email with your recommendations!
Last updated
Was this helpful?