Skip to main content
Dynamic Content Block Variants in Klaviyo
Ana Bunaiasu avatar
Written by Ana Bunaiasu
Updated this week

Lantern now allows dynamic content block variant IDs to be sent to Klaviyo upon quiz completion. This feature helps you personalize your emails dynamically, based on the relevant variant that was displayed to your customers on the quiz results page.

How It Works

Each variant created within a dynamic content block in Lantern is assigned a unique ID. When a quiz is completed, Lantern sends the IDs of the ‘winning’ content block variants to Klaviyo as part of the "Completed Lantern Quiz (v2)" event.

This allows you to:

  • Personalize email content based on the variant displayed on the results page.

  • Automate email flows tailored to distinct customer preferences.

Key Data Sent to Klaviyo:

  • winner_variants: An array of unique IDs representing the chosen content block variants.

Setting Up Dynamic Content in Klaviyo

In our example, we'll use a pet food quiz tailored with 6 dynamic content block variants, focusing on different life stages of pets: three variants for dogs (puppy, adult, senior) and three for cats (kitten, adult cat, senior cat). Here’s how we can customize the content of our Klaviyo email based on which variant was displayed on the results page:

1. Using Klaviyo's Display Logic with Sections

Utilize Klaviyo's built-in show/hide logic to tailor content in emails based on the winner variant IDs.

Steps to Implement:

1.1. In the Klaviyo email editor, create a separate section of content for each content block variant, such as one for puppies, another for adult dogs, etc. You can include any type of content you want inside a section such as images, buttons, dividers etc, but in our example, we’ll only add text.



1.2. For each section, navigate to Display settings and under Show/hide logic, click the Use code option to input custom display conditions.

1.3. Enter the condition to check if the variant ID is in the winner's array. In our example, for the puppy diet section, our condition will be:

"VARIANT_ID for puppy" in event.winner_variants

This logic ensures that the section only displays if the quiz results page shows the puppy variant, indicating that the quiz taker has a puppy.

You can copy the correct variant ID from inside your content block.

1.4. Repeat this process for each section.

Example: If a quiz participant's results indicate they have a puppy, the puppy variant will be included in the winner_variants array sent to Klaviyo. In the email template, the section with puppy-specific content will only display if this variant ID is found in the array, meaning quiz rakers will only see this section if it is shown to them on their results page.

2. Using Flow Triggers and Filters

Create distinct flows for different pet types using Klaviyo's Flow Builder.

Steps to Implement

2.1. Create a New Flow: In Klaviyo, initiate a new flow triggered by the "Completed Lantern Quiz (v2)" event.


2.2. Set Up Trigger Use Trigger Filters to segment the flows based on specific content block variant IDs. To do this click the Add button next to the Trigger filters option.

2.3. On the next screen, click Add Trigger filter.

2.4. Enter the correct filter based on the variant ID by following these steps: 2.4.1.Select the dimentionwinner_variants 2.4.2. Set the rule as contains 2.4.3 Select the correct 'VARIANT_ID' from the drop-down. In our case, this will be the puppy variant

Please note: to have all available variant IDs in this drop-down, you must first complete the quiz and make sure each variant was presented as a result. This is the only way the information will be sent to Klaviyo, and the variant ID will be present in the drop-down.

2.5. Save your trigger filter then Save your new flow

2.6. Customize Email Templates: Develop customized email templates for each variant. For the puppy variant, the email content might focus on puppy nutrition, training tips, and suitable products for puppies.



In our case, there are six distinct variants (three for dogs and three for cats), and we will need to set up six separate flows. So this solution is suitable if you have a relatively small number of variants.

Example for Implementing Puppy Flow:

Flow Name: Puppy Food Recommendations
Trigger Condition: winner_variants contains 'VARIANT_ID for PUPPY'
Email Content: Include tips, and product recommendations specifically beneficial for puppy care and development.

Common Questions

Q: Can the full content of the winning dynamic content block be sent to Klaviyo?

  • No, due to API payload limitations and HTML formatting challenges, only the variant ID is sent.

Q: What if multiple content blocks are used in a quiz?

  • All winning variant IDs are included in the array, enabling personalized content based on multiple quiz results.

Q: Can multiple emails be triggered based on quiz results?

  • Yes, different flows can be set up using trigger filters based on specific variant IDs to cater to diverse customer needs.

By incorporating the above strategies, you can effectively utilize Lantern's dynamic content blocks in Klaviyo, ensuring targeted and highly personalized email marketing campaigns that resonate with your customer’s specific needs.

Did this answer your question?