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!
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.
Braze does not currently support 100% of Shopify’s Liquid, only certain portions which we have attempted to outline in our documentation. We highly recommend testing all messages using Liquid before sending them to reduce the risk of errors or using unsupported Liquid.
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.
Refer to our Filters article for definitions.
Terms to know
These terms are reinterpreted from Shopify’s documentation based on our level of support.
|Liquid||An commonly-used, customer-facing template language created by Shopify and written in Ruby; used to load/pull dynamic content.||
|Object||A denotation of a variable and location of the intended variable name that tells Liquid where to show content in the message.||
|Conditional logic tag||Tags create logic and control the flow of message content. In Braze’s cases, conditional logic tags are used to create exceptions and variations in messages based on certain, predefined criteria.||
|Filters||Used to change, narrow, or reformat the output of the Liquid object. It is often used to create mathematical operations.||
|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