Liquid Tags

Prev Next

Liquid is a templating language created by Shopify. It acts as a bridge between static content and dynamic data. Liquid is made of three building blocks: objects (output values), tags (logic), and filters (transform values).

Liquid is available for early access. The early access products include the standalone App Push, Enhanced Templates, Email channels, and Enhanced Templates and Email in Architect journeys. To be a part of the early access, contact the Insider One Team.

Building block

Syntax

Purpose

Object

{{ }}

Outputs the value of the variables

Tag

{% %}

Logic and control flow if, for, assign, etc.

Filter

|

Transforms a value before output; upcase, round, time_format, etc.

You can apply multiple filters in a row. Each filter takes the output of the previous one as its input.

{{ price | times: 100 | round }}

1. Start with price → value is 9.764
2. times: 100 → multiplies it → 976.4
3. round → rounds it → 976

Filters are applied sequentially. Each one takes the preceding filter's output as its own input, forming a transformation pipeline from left to right.

Liquid supports whitespace control via hyphen modifiers (-) placed inside delimiters. When applied, all whitespace characters, including spaces and newlines, immediately preceding or following the delimiter are removed from the rendered output.

{%- if condition -%}
  ...
{%- endif -%}
{{- name -}}
A{%- if true -%}B{%- endif -%}C
→  ABC

Liquid Tags offer the following components:

  • Variables: Learn how to reference user attributes from Insider One’s Unified Customer Database in your templates, and how to handle cases where a variable has no value.

  • Filters: Find the full list of filters available for transforming strings, numbers, arrays, and dates, including Insider-specific filters like number_format and time_format.

  • Operators: See all comparison and logical operators supported in Liquid conditions, and learn how to handle grouping when parentheses are not available.

  • Tags: Explore all available tags for control flow, loops, and variable assignment, with syntax references and examples for each.

  • Default Values: Learn how the default filter works, which values trigger it, and when to use it versus an explicit condition.

  • Conditional Logic: Find guidance on writing conditions with {% if %}, {% elsif %}, and {% unless %}, including how truthy and falsy values behave in Liquid.

  • Aborting Messages: Learn how to use {% abort_message %} to prevent a message from being sent when required data is missing or a user doesn’t meet the campaign criteria.

  • Chaining Filters: See how to apply multiple filters in sequence and explore common chaining patterns for formatting, calculation, and array manipulation.

  • Use Cases: Find ready-to-use template examples covering personalization, loyalty tiers, birthday messages, SMS formatting, dynamic subject lines, and more.

  • FAQ: Get answers to common questions about Liquid behavior, including edge cases around blank values, type comparisons, date parsing, and abort logic.