Put your customer data to work
Customer data is incredibly valuable, but it can be tough to figure out what to do with all of the data you’ve collected. When it comes to building emails, you can leverage the data stored on your customer profiles to create messages that feel personal to each individual. Instead of broadcasting the same message to every subscriber, add in dynamic text, show or hide blocks of content, and include smart product recommendations based on someone’s history with your brand.
Use show/hide blocks to personalize emails
Let’s look at a real-world example of how to use profile properties to show or hide content dynamically. In this video, we’ll walk through step-by-step how Beantown Coffee dynamically displays members-only promotional offers to their loyalty program members by using show/hide logic.
Understand personalization tags in Klaviyo
Personalization tags allow you to dynamically add data into messages that is most relevant to the recipient. Add these to email subject lines, email body text, and SMS/MMS messages to create a more personalized connection with recipients.
In particular, you can incorporate the following types of personalization tags. Most use double curly brackets, but link and preview tags use a curly bracket and percent symbol instead, so watch the syntax carefully.
Pull data connected directly to a profile or an event. When used in flows, these populate details from the event that triggered the flow, like the items in someone's order or a shipment tracking number.
Example: {{ person.email }}
Use custom object data in your sends. You must create the object before you can reference it in a message.
Example: {{ object.object_property }}
Include information about your own company in a message. These tags always start with "organization."
Example: {{ organization.name }}
Add elements like your unsubscribe or manage preferences links. These use a curly bracket and percent symbol rather than double curly brackets.
Example: {% unsubscribe_link %}
Populate a custom profile property, such as someone's birthday or a specific interest you collected in a sign-up form.
Example: {{ person|lookup:'Favorite Food' }}
Reference data from the specific event that triggered a flow message, such as a placed order.
Example: {{ event.URL }}
Populate a particular date in your message.
Example: {{ today }}
Pull data connected directly to a profile or an event. When used in flows, these populate details from the event that triggered the flow, like the items in someone's order or a shipment tracking number.
Example: {{ person.email }}
Use custom object data in your sends. You must create the object before you can reference it in a message.
Example: {{ object.object_property }}
Include information about your own company in a message. These tags always start with "organization."
Example: {{ organization.name }}
Add elements like your unsubscribe or manage preferences links. These use a curly bracket and percent symbol rather than double curly brackets.
Example: {% unsubscribe_link %}
Populate a custom profile property, such as someone's birthday or a specific interest you collected in a sign-up form.
Example: {{ person|lookup:'Favorite Food' }}
Reference data from the specific event that triggered a flow message, such as a placed order.
Example: {{ event.URL }}
Populate a particular date in your message.
Example: {{ today }}
Read our message personalization reference for detailed instructions on how to add personalization tags to your emails.
Use filters to manipulate personalization tags
Sometimes the data stored on a profile needs a little bit of tweaking for it to make sense in the context of your message. You can apply filters to variables in Klaviyo to make changes like adding default text, capitalizing letters or adding title case, formatting a date, or splitting a value into pieces. To add a filter to a variable, use this format:
{{ your_tag|filtertext }}
Check out the list below for some of the most popular filter use cases.
Set a default value when a personalization tag is empty
Filter text: default
Format: {{ your_tag|default:'friend' }}
When to use it: This is one of the most popular filters because it adds a default value when other data is not available for a particular tag. Most notably, brands will use “friend” as default text for a first name if a profile does not have a first name stored.
Change text capitalization
Filter text: lower or upper
Format: {{ your_tag|lower }} or {{ your_tag|upper }}
When to use it: If you have data stored with varying levels of capitalization for a certain profile property, use these filters to change every character in the string to lowercase or uppercase.
Show a certain number of decimal places on a number
Filter text: floatformat
Format: {{ your_tag|floatformat:# of decimal places to display }}
When to use it: If your Klaviyo account is integrated with other systems, it’s possible that numeric values may sync into your account with or without the desired number of decimal places. Easily add or remove the number of decimal places displayed using this filter.
Change a timestamp into a reader-friendly date
Filter text: format_date_string
Format: {{ your_tag|format_date_string }}
When to use it: Often, tech platforms will store dates as UTC timestamps, which can be hard to read and understand. Clean up timestamps and format them with the exact date and time layout that you want using this filter. Explore all options for date and time filtering here.
Below are some additional resources to help you use filters for variables: