Liquid in Web Push

Prev Next

Liquid is a templating language that lets you inject dynamic, personalized content into your standalone Web Push notifications. Instead of sending the same message to everyone, you write a single template and Liquid fills in the right data for each recipient automatically: their name, the product they last viewed, their city, and more. You can branch on a value, give it a fallback, and format dates, numbers, and text.

In Insider One Web Push, Liquid is available in the Message Title and Message Description fields. It works in standalone campaigns and in Architect journeys.

The Liquid Tags feature is available for early access. To activate it for your account, contact the Insider One team.

Supported

Not supported

  • Message Title and Message Description

  • Conditions, loops, filters, and default values

  • abort_message to skip a recipient

  • Message icon, rich image, and dynamic image

  • Message link (Custom Link and Dynamic Link)

  • Action button labels and URLs

Liquid support differs by campaign type:

Campaign type

Liquid Tags

Preview as User

Notes

Single

Yes

Yes

-

Trigger

Yes

Yes

Attribute values come from the visitor's browser when the push is triggered

Cart Reminder

Yes

No

Attribute values come from the visitor's browser when the push is triggered

Back In Stock

Yes

No

-

Price Drop

Yes

No

-

Welcome

No

No

Dynamic content is not available for Welcome campaigns

This guide explains the following concepts:

Enable Liquid Tags

Step 1: Liquid Tags toggle

In your Web Push campaign, go to the Design step. In the Message Content section, you will see the Liquid Tags toggle in the top-right corner. By default, this toggle is off.

The Liquid Tags toggle and its tooltip in the Message Content section of a Single Web Push

Welcome campaigns have no Liquid Tags toggle. Their Message Title and Message Description stay plain text, without dynamic content.

A Welcome campaign: the Message Content section has no Liquid Tags toggle

Step 2: Enable Liquid Tags

Click the toggle to enable Liquid Tags. It turns blue with a checkmark, and the Message Title and Message Description fields switch to code editors with line numbers and syntax highlighting. Under each editor, you can use Add Dynamic Content, Add Emoji, and the expand icon to edit in full screen.

  • If both fields are empty, the toggle switches immediately.

  • If either field already has content, a confirmation dialog appears.

Select Disable and Delete (or Enable and Delete) to continue, or Cancel to keep your content and stay in the current mode.

The confirmation dialog shown when you turn Liquid Tags off while the fields have content

Copy your message before switching modes. Switching between the standard and Liquid modes clears both fields.

Step 3: Write Liquid in the title and description

Type your Liquid code directly into the Message Title and Message Description editors. The character counters you see in standard mode don't show while Liquid is on because the final length depends on each recipient's data.

Liquid conditions written in the Message Title and Message Description editors

The notification preview on the right updates as you type, but shows the raw Liquid code. This is expected behavior. The code is resolved for each recipient at send time. To see the result for a real user, use Preview as User.

Personalize with dynamic content

Step 4: Personalize with dynamic content

Click the Add Dynamic Content button under an editor to browse the attributes you can use and insert them without typing. The list is grouped into Default Attributes, Custom Attributes, Expressions, Aggregates, Lookup Tables Attributes, and Array of Objects Rules. Trigger, Cart Reminder, Back In Stock, and Price Drop campaigns also list Lookup Tables Parameters.

In standalone Web Push, attributes are inserted in Liquid form with a d_ prefix for default attributes, e.g., {{d_city}} or {{d_last_visited_product_name}}. You can use them directly in conditions and filters.

Default attributes are inserted with their Liquid names, for example {{d_city}}

If you type an attribute name that does not exist in your account, the editor marks it in red with the name it rejected. Select the attribute from Add Dynamic Content to get the right name.

An unknown attribute name is rejected with the name shown in the error

On Trigger and Cart Reminder campaigns, the values come from the visitor's browser at the moment the notification is triggered. When both the browser and the user profile have a value, the browser value is used.

Preview and test your message

Step 5: Preview and test your message

On Single and Trigger campaigns, open Preview as User above the preview, choose a User Selection Method (e.g., Recent User), pick a user, and click Preview as User. The preview renders your Liquid with that user's data, and the header changes to Previewing as followed by the user.

Preview as User renders the Liquid title and description with the selected user's data

Click the Test Message button to send a test notification. If you selected a user, the test shows that user's rendered content. If you did not, the test shows the raw Liquid code.

Cart Reminder, Back In Stock, and Price Drop campaigns do not have Preview as User. Their preview always shows the raw Liquid code, so check your conditions carefully and keep a default value for every attribute.

If the title renders empty for the selected user, a warning under the preview tells you that the notification will be sent with the browser's default title. Add a default value to the title to avoid this.

Liquid errors

If your Liquid code contains a syntax error, the editor marks the line with a red icon, underlines the part that failed, and shows a message under the field, e.g., "Enter a valid Message Title to continue." An empty field shows "Enter a Message Title to continue." or "Enter a Message Description to continue."

A missing endif marks the Message Title as invalid

When you click the Save and Continue button with an error, the page scrolls to the field and a warning asks you to "Check and update all required fields to continue." The campaign is not saved until every error is fixed.

The most common causes are the same as in the other channels:

  • Unclosed tag: every {% if %} needs {% endif %}, every {% for %} needs {% endfor %}.

  • Missing colon in a filter: write | default: "there", not | default "there".

  • Unmatched quotes: every opening " needs a closing ".

  • Misspelled filter name: titlecase does not exist; the correct filter is capitalize.

What happens at send time

  • Liquid is rendered separately for every recipient, just before the notification is sent.

  • If a recipient's template runs {% abort_message %}, that recipient does not receive the notification. Everyone else does.

  • If the template cannot be rendered for a recipient, for example because a date filter receives a value it cannot read, that recipient does not receive the notification.

  • If both the title and the description render empty for a recipient, the notification is not sent to them.

  • Very long rendered text is shortened to fit the browser's limit without a warning. Keep your branches short.

Use cases

For each use case, enable Liquid Tags, then paste the code into the field named above it.

Use case 1: Greet with a name fallback

Message Title:

{{ d_name | capitalize | default: "Hi there" }}, your weekend deal is here

When the name is Ada, the title reads "Ada, your weekend deal is here". When the name is empty, it reads "Hi there, your weekend deal is here".

Use case 2: Remind users of the product they viewed

Message Description:

{% if d_last_visited_product_name != blank %}{{ d_last_visited_product_name }} is 20% off until Sunday.{% else %}Up to 20% off this weekend only.{% endif %}

Use case 3: A different message per city

Message Title:

{% if d_city == "Istanbul" %}Free same-day delivery in Istanbul{% else %}Free delivery on orders over 500 TL{% endif %}

Use case 4: Skip users without the data that makes the message relevant

Message Title:

{% if d_last_visited_product_name == blank %}{% abort_message "No product to remind" %}{% endif %}Still thinking about {{ d_last_visited_product_name }}?

Users without a last visited product do not receive the notification. All other users do.