We store customer data in both the app and in Shopify’s metafields. This allows you as a developer to access this data either through the Shopify API or Liquid. If you haven’t already, learn about how metafields work in Shopify by reviewing their documentation.

Read custom data in Liquid

All of a customer’s custom data is stored in a single JSON metafield: Here’s how you can access the column my_column_key:

{{["my_column_key"] }}


{{ }}

This can be used anywhere on a theme. However, that’s a very elongated path to the data you want. We recommend assigning a variable to so you don’t have to keep repeating it:

{% assign custom_data = %}

{{ custom_data["some_column"] }}
{{ custom_data["some_other_column"] }}

Custom data types

The data metafield is of the json_string type, allowing all of its contents to be used like any other proper liquid variable.

For instance, date columns can have date filters applied to them:

{{ custom_data["birthday"] | date: "%a, %b %d, %y" }}
Mon, Jun 8, 98

integer and float columns can have math filter applied to them:

{{ custom_data["some_float"] | plus: custom_data["some_integer"] }}

… and so on!

Access legacy data

We’ve changed how we add custom data to metafields since December, 2019 with our new forms feature. This drastically improved issues with Shopify’s rate limits and thus updates to metafields are no longer delayed. Here’s an example of how it used to be, accessing a key called birthday:

{{ customer.metafields.customr["birthday"] }}

Now, all custom data is store under a new namespace and a single key:

{{["birthday"] }}

But what if you still have old metafields? You’ll need to use the default filter and fall back to the old metafields path in case the new metafield isn’t present:

{{["birthday"] | default: customer.metafields.customr["birthday"] }}

Next up: JavaScript Customer API