Intro to variables

Variables are dynamic data placeholders that you can use inside Hubble to personalize content for individual customers. By using variables, you can make your blocks feel more personal and relevant.

What are variables?

Variables are pieces of code that Hubble replaces with real data when a customer views your content. For example, instead of saying "Hello customer", you can use a variable to say "Hello Jane".

Why use them?

Personalization is key to engaging customers. Variables allow you to:

  • Greet customers by name

  • Display specific account details

  • Show relevant dates or information

How they work inside Hubble

Hubble's variables follow Shopify Liquid’s nomenclature and style so that they feel familiar to merchants who are used to Shopify.

Liquid-inspired syntax

Variables are wrapped in double curly braces: {{ }}.

Example: {{ customer.first_name }}

Limitations

The most important rule to remember is: If it's not in the modal picker, it's not supported.

Hubble uses a specific engine to render these variables, so standard Liquid logic (like {% if %} tags or complex loops) or unsupported variable names will not function as expected.

Examples

Here are a few basic ways to use variables:

Simple variable:

{{ customer.first_name }}

Variable with a fallback (default value):

{{ customer.name | default: 'dear customer!' }}

Common variables

Here are some of the most commonly used variables available in Hubble:

Variable
Description

customer.first_name

The customer's first name.

customer.last_name

The customer's last name.

customer.email

The email address of the customer.

Last updated