Skip to content

Personalization Using Liquid Tags

Braze can automatically substitute values from a given user into your messages. Put your expression inside of two sets of curly brackets to notify Braze that you’ll be using an interpolated value. Inside of these brackets, any user values that you want to substitute must be surrounded by an additional set of brackets with a dollar sign in front of them.

For more on Liquid, check out our guided Dynamic Personalization with Liquid Braze Learning path!

About Liquid

Liquid is an open-source template language developed by Shopify and written in Ruby. At Braze, Liquid is used to template data from a user’s profile into messages.

For example, you can retrieve a custom attribute from a user profile that is an integer data type and round that value to the nearest whole number. For more on Liquid syntax and usage, refer to Supported personalization tags.

Liquid templating language supports the use of objects, tags, and filters.

  • Objects allow you to insert personalized attributes into your messages.
  • Tags allow you to insert data into messaging and use conditional logic to send messages if outlines conditions are met. For example, you can use tags to include intelligent logic, such as “if” statements, in your campaigns.
  • Filters allow you to reformat personalized attributes and dynamic content. For example, you could convert a timestamp, such as 2016-09-07 08:43:50 UTC, into a date, such as September 7, 2016.

What’s new with Liquid 5

Braze has updated support to Liquid up to and including Liquid 5 from Shopify.

Liquid implementation supports syntax personalization tag types and whitespace control. For more information on specific tags, refer to syntax tags.

The following new array and math filters are available for use in your Liquid as you build your messaging.

  • at_least
  • at_most
  • compact
  • concat
  • sort_natural
  • where

Refer to our Filters article for definitions.

Terms to know

These terms are reinterpreted from Shopify’s documentation based on our level of support.

Term Definition Example
Liquid An commonly-used, customer-facing template language created by Shopify and written in Ruby; used to load/pull dynamic content. {{${first_name}}} will insert a user’s first name into a message.
Object A denotation of a variable and location of the intended variable name that tells Liquid where to show content in the message. {{${city}}} will insert a user’s city into a message.
Conditional logic tag Tags create logic and control the flow of message content. In Braze, conditional logic tags are used to create exceptions and variations in messages based on certain, predefined criteria. {% if ${language} == 'en' %} will trigger your message in a designated way in the event that a user has designated “English” as their language.
Filters Used to change, narrow, or reformat the output of the Liquid object. It is often used to create mathematical operations. {{"Big Sale" | upcase}} will cause the words “Big Sale” to appear as “BIG SALE” in the message.
Operators Used in messages to create dependencies or criteria that can affect which message your user receives. If a user meets the defined criteria in a message tagged with {% custom_attribute.${Total_Revenue} > 0%}, they will receive the message. If not, they will receive another designated message (or not), depending on what you set.

New Stuff!