FLOWS

Klaviyo dynamic content: show and hide blocks without breaking your emails

Klaviyo dynamic content means one email that changes for each person: variables like {{ first_name|default:'there' }} fill in their details, and show/hide logic on a block or section decides whether they see it at all. You set show/hide logic in the drag-and-drop editor on a block's Display tab, using profile properties in any email or trigger event properties in event-triggered flow emails, and you test it by previewing with real profiles and events before anything goes out.

Jack White
Jack White Founder, Bardown Digital
Updated · 9 min read
KEY TAKEAWAYS
  • Show/hide logic lives on the Display tab of a block or section, and only in drag-and-drop templates.
  • Profile conditions work in campaigns and flows. Event conditions only work in flow emails triggered by that event, so they're blank in campaigns.
  • Always add a fallback when you use multiple variants. Without one, anyone who matches nothing sees an empty space.
  • Preview with a profile that matches, one that doesn't, and one that's missing the property entirely.
  • Use show/hide for a small change inside one email. Use a split when the message, timing or offer is different, like customer vs non-customer paths.

This is for Shopify founders who want to personalize an email without building five copies of it. Here's how it works, where it breaks, and when to use a split instead.

What is dynamic content in Klaviyo?

There are three pieces, and they get lumped together:

  • Variables (template tags). These print data into the email. Profile data looks like {{ person.Birthday }} or, for names with spaces, {{ person|lookup:'Favorite Color' }}. Event data looks like {{ event.URL }} or {{ event.extra.checkout_url }}. Klaviyo's personalization reference says all tags are case sensitive and must exactly match the property names.
  • Show/hide logic. This decides whether a block or section appears for each recipient.
  • Dynamic product blocks. These pull products from a feed (best sellers, recently viewed, "may also like") instead of products you picked.

All three break the same way: the data isn't there, or isn't spelled the way you think.

Where do you set show/hide logic in Klaviyo?

Per Klaviyo's show/hide guide:

  1. Select a block or section and open the Display tab.
  2. Under Show/hide logic, choose Show only to a specific audience.
  3. Pick a condition type. Properties about someone uses profile data. Properties of [your trigger event], like "Properties of Placed Order," uses event data and only shows up in flow emails triggered by an event.
  4. Choose the property, the comparison and the value. Add more conditions with AND or OR.
  5. Click Save.

Limits to know first:

  • It only works in drag-and-drop templates. For an HTML template, Klaviyo's route is Clone to drag and drop from your saved templates, which leaves the original alone.
  • The builder handles text, number and list data. Dates, booleans and nested event values like event.Items.0 need custom code.
  • The property needs to already exist on at least one profile or event in your account.

What does the custom code syntax look like?

If the builder can't do what you need, click Use code. Klaviyo's conditional logic reference says to enter the expression by itself, with no {{ }} or {% if %} around it. Some examples straight from Klaviyo's pages:

  • person|lookup:'Bag Preference' == 'Work' shows the block to people whose property equals "Work."
  • person|lookup:'Age' > 20 is a number comparison. Numbers don't get quotes.
  • 'green' in person|lookup:'Favorite Colors' checks whether a list contains a value.
  • 'ITEM_NAME' in event.Items shows a block to people whose trigger event included that product, swapping in the exact product name.
  • person|lookup:'Favorite Color' on its own shows the block only if the property has a value.

Use lowercase and and or, with spaces around comparison operators. Klaviyo evaluates and before or, so mixed conditions can let people in through a side you didn't expect.

Klaviyo warns that Convert to code can't be undone and its support team doesn't troubleshoot custom code. If Django-style syntax isn't your thing, stay in the builder.

To find the right variable path, Klaviyo suggests inserting the property from the Personalization menu on a text block, copying what's inside the tag, and removing the curly brackets and filters like |default:'' (keep the lookup parts). For event data, copy it from Preview with the data source set to Event. Paths vary, for example event.extra.line_items.0.title.

How does it work in campaigns vs flows?

This is the one that catches people. Profile-based conditions work everywhere. Event-based conditions only work in flow emails triggered by that event.

Klaviyo is specific: event properties come from the flow's trigger event only. They aren't available in campaigns, list-triggered flows or date-triggered flows, and they don't look up someone's past events. So if you reuse a "Properties of Placed Order" block in a campaign, the logic has nothing to read. The same goes for event variables, which Klaviyo says "can only be used in flows triggered by that event."

How do logic variants and fallbacks work?

If you want different content for different groups in the same spot, choose Personalize for multiple audiences. Each variant gets its own content and condition. Klaviyo's rules:

  • Variants are checked top to bottom, and each person sees only the first one they match.
  • Add fallback creates a Default variant for anyone who matches nothing. Without it, those people see nothing there.
  • You get up to 10 variants plus one fallback per block or section.
  • Analytics aren't broken out by variant.
  • A coupon inside a variant generates codes for every recipient, including people who see a different variant.

How do you preview dynamic content before it sends?

Don't trust the canvas. Klaviyo says the canvas doesn't evaluate conditions, so you have to use Preview.

  • For campaigns, templates and non-event flows, use Search profiles to pick a real person. The default preview is tied to your own login and only has your name and email.
  • For event-triggered flow emails, use the arrows to step through up to 10 recent events. The preview uses the profile tied to each one.
  • To send a test, pick the profile or event, enter addresses under Send a preview using a profile, then Send test. Every test recipient sees the selected profile's data, not their own.

Klaviyo's show/hide guide gives a simple checklist: preview a profile that matches, one that doesn't, and one that's missing the property. For flows, check matching and non-matching trigger events. For variants, check one person from each audience plus one who matches nothing.

Why do dynamic blocks break or disappear?

Klaviyo's docs point to the same handful of causes again and again.

Wrong variable path or spelling. Property names and text values are case sensitive. "VIP" isn't "vip," and "MA" isn't "Massachusetts." Klaviyo suggests covering spelling variants and people missing the property.

Logic that hides everything. If a section and a block inside it both have logic, the block shows only when both are true. Conflicting conditions can hide it from everyone. Same story with variants and no fallback.

Missing data. The plain "show if this property exists" check hides the block when the value is missing, empty, numeric 0 or false. And Klaviyo notes the "is not set" condition also matches empty and false values, including 0. If a loyalty member can have 0 points, Klaviyo's own example says to use a membership property instead of the points balance.

Text vs numbers. In custom code, the text "22" and the number 22 aren't the same. Klaviyo's fix is person|lookup:'Age'|multiply:"1" > 21, which turns numeric text into a number first.

Blank variables. Klaviyo's preview guide says variables with no data won't render unless you set a default. Use the default filter: {{ first_name|default:'friend' }}. Tags you copy from the preview panel already come with |default:'', so swap in a real word. And keep the quotes straight: Klaviyo flags mistakes like misplaced quotes and bad filter syntax with a "Could not parse the remainder" error.

What about dynamic product blocks?

A product block set to Dynamic pulls from a product feed, which you create under Content > Products > Product feed. Classic feeds show everyone the same items, like best sellers. Personalized feeds use things like recently viewed or "Products a customer may also like," and Klaviyo makes you choose a classic fallback for people with limited history. Klaviyo also excludes items without images, items the person already bought, out-of-stock items and the flow's trigger item.

But for cross-sell, my default is per-product versions of the flow (one layout, duplicated for each item) rather than dynamic product blocks. The alternative is one general flow, which gets more sends and shows you which products people buy at a given point in their lifecycle. When I pick the pairs, accessories get recommended later, so you're not hounding someone who just bought. I go deeper on this in Klaviyo product blocks vs hand-picked products and the full build in my cross-sell email flow post.

Should you use show/hide or a conditional split?

Show/hide changes part of one email. A split sends people down different paths in the flow, each with its own emails and timing. Klaviyo's split guide says paths are checked in order, a profile goes down the first one it qualifies for, and anyone who matches nothing goes down "Everyone else." Klaviyo is moving conditional and trigger splits into a single multi-branch split with up to 20 paths.

My rule of thumb:

  • Show/hide when it's a small swap: a banner, a line of copy, an image, a product note for people who abandoned a specific item.
  • A split when the whole message changes: a different offer, a different number of emails, different timing, or when you want to see results for each group. Remember, Klaviyo doesn't break out analytics by show/hide variant.

Customer vs non-customer is the clearest split case. Those are different conversations, so they get different branches. For example, gifting lines go in the customer branches of my abandonment and welcome flows, to give a reason to complete the order. If you haven't set those branches up, start with customer vs non-customer email flows.

And if someone shouldn't get an email at all, that's neither. That's a filter. I break down the difference in Klaviyo flow filter vs trigger filter.

FAQ

Can I use show/hide logic in a Klaviyo campaign?

Yes, with profile properties. Event-based conditions only work in flow emails triggered by that event, so they won't work in campaigns.

Why is my show/hide block not showing for anyone?

Check spelling and capitalization, whether a section and a block inside it both have logic, and whether you used variants without a fallback. Then preview with a profile you know matches.

Do I need `{{ }}` in show/hide custom code?

No. Klaviyo says to enter the expression by itself, like person|lookup:'VIP' == 1, without {{ }} or {% if %} tags.

How do I stop a blank first name in Klaviyo?

Add the default filter: {{ first_name|default:'there' }}. Klaviyo says variables with no data won't render unless a default is set.

Does Klaviyo report results by show/hide variant?

No. Klaviyo says analytics aren't broken out by variant. If you need to compare groups, use a split.

Jack White, founder of Bardown Digital
WRITTEN BY Jack White

Founder of Bardown Digital, a Chicago-based Klaviyo email and retention agency for Shopify brands. He's worked with brands doing $500K to $100M a year, with $100M+ in email-attributed revenue across them.

SOURCES

Keep reading

All posts →
FLOWS · 10 MIN READ

Klaviyo back in stock emails: how to set them up so the restock actually sells

How to set up Klaviyo back in stock emails, from the flow to the restock campaign, plus why one restock email got double the clicks and made $0.

Read the post →
FLOWS · 9 MIN READ

Klaviyo custom properties: what to store and how to use it

Klaviyo custom properties store what Shopify doesn't know: birthdays, survey answers, quiz results, preferences. What to save, how to name it and use it.

Read the post →
FLOWS · 9 MIN READ

Klaviyo discount codes not working? Where the Shopify sync breaks

Klaviyo discount code not working at Shopify checkout? Check preview codes, dates, usage, cart rules, combinations, edits and code supply, in that order.

Read the post →

Want me to check your flow logic?

A block that hides for the wrong people is an email that quietly stops selling. The first strategy session is free: one hour, live with me in your Klaviyo account, and you leave with a fix list even if we never work together. Not ready to book? Grab one of my free resources instead.

Book a strategy session
Or email me at jackwhite@bardowndigital.com