Liquid Reference

Liquid is a template language created by Shopify and written in Ruby. It is now available as an open source project on GitHub, and used by many different software projects and companies. Liquid is the backbone of all Shopify themes, and is used to load dynamic content to the pages of online stores. (Source:

Designers and developers can use template language to combine static and dynamic content to populate pages with data from a Shopify store. Static elements are written in HTML and dynamic elements are written in Liquid.  

Infusionsoft's Broadcast Email and Campaign Builder's email are where Liquid syntax is currently available for use.

For more information on Liquid syntax please see the open source documentation on Shopify's Page.

Prior to Liquid Content, your campaign in Campaign Builder might look something like this...

After, your campaign may look like this: 

Double clicking on the Dynamic Content icon reveals this

Liquid Code Basics


  • Tell Liquid where to show content
  • Denoted by double curly or square braces: {{ and }} or [[ and ]]


  • ==    equal to
  • !=     not equal to
  • >      greater than
  • <      less than
  • >=    greater than or equal to
  • <=    less than or equal to
  • or     this OR that
  • and    must be this AND that
  • contains    contains


  • Create the logic and control flow for templates
  • Denoted by curly braces and percent signs: {% and %}


  • Change the output of a Liquid object
  • Used within an output and are separated by a |

Examples of Liquid

Liquid basic syntax

{{ contact.firstname }}George

Fallback Values (i.e.defaults)

Hi {{ contact.firstname | default: 'there' }}Hi George

If Contact does not have a first name: Hi there

Control flow tags - based on Number of Employees

{% if contact.numberofemployees > 50 %}With a large organization like yours, communication is key.
{% elsif contact.numberofemployees > 5 %}In SMBs, the key is balance.
{% else %}In a micro-org like yours, you need to save every dollar.
{% endif %}

Control flow tags - based on Email Domain

{% if contact.email1.address contains ‘’ %}<a href= "">Gmail sync for Keap</a> captures the email communications in Gmail into your contact record.
{% else %}<a href= "">Gmail sync</a> and <a href= "">Microsoft email sync</a> for Keap captures email communications into your contact records.
{% endif %}


{{ }}2019-08-13
{{ | short }}8/13/19
{{ | medium }}Aug 13, 2019
{{ | long }}August 13, 2019
{{ | full }}Tuesday, August 13, 2019
{{ | plus_days: 14 | full }}Tuesday, August 27, 2019

Case Statements

Hello ~Contact.FirstName~,


{% capture day %}{{ 'now' | date: '%A' }}{% endcapture %}

{% case day %}

{% when 'Sunday' %} Check out our Sunday specials!

{% when 'Monday' %} Check out our Monday specials!

{% when 'Tuesday' %} Check out our Tuesday specials!

{% when 'Wednesday' %} Check out our Wednesday specials!

{% when 'Thursday' %} Check out our Thursday specials!

{% when 'Friday' %} Check out our Friday specials!

{% when 'Saturday' %} Check out our Saturday specials!

{% endcase %}

Was this article helpful?
Thank you for your feedback!