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:
- Profile personalization tags: Pull data that is directly connected to an event or a profile. When used in flows, these can populate details from the event that triggered the flow (like the items in someone’s order, or a shipment tracking number). A pair of curly brackets surround the tag content, and look like this: {{ person.email }}.
- Custom object tags: Allow to you to use object data in your sends. You must create an object first before you use this tag. It might look like this: {{ object.object_property }}.
- Organization tags: Include information about your company in your messages. These start with "organization"; for example: {{ organization.name }}.
- Link and preview tags: Add elements like your email unsubscribe or manage preferences links. A set of curly brackets and the percent symbol surround the template tags, and look like this: {% unsubscribe_link %}.
- Custom personalization tags: Populate custom profile properties, like someone’s birthday or specific interests. For example, if you collect someone's favorite food in a form, you could incorporate the following tag in an email: {{ person|lookup:'Favorite Food' }}.
- Event tags: Reference a specific event’s data (e.g., a placed order) in flow messages triggered by that event; for example, pull the URL for an order with: {{ event.URL }}.
- Date tags: Populate a particular date in your message, such as {{ 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.
Make all text lowercase
Filter text: lower
Format: {{ your_tag|lower }}
When to use it: If you have data stored with varying levels of capitalization for a certain profile property, you can easily change all characters within the string to lowercase.
Make all text uppercase
Filter text: upper
Format: {{ your_tag|upper }}
When to use it: If you have data stored with varying levels of capitalization for a certain profile property, you can easily change all characters within the string to 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: