How to use metafields in Shopify and segment your customers

Find out how to create, view and use Shopify metafields to segment your customers. We will cover the basics in a comprehensive guide with 5 top questions and answers.
Froonze
April 15, 2024

One of the most powerful features of Shopify is its ability to segment customers based on their behavior, preferences, and other attributes. This can help businesses create targeted marketing campaigns, offer personalized discounts, and improve customer retention.

Metafields are a great tool in Shopify that can help businesses segment their customers more effectively. Metafields are custom fields that can be added to products, orders, and customers. They allow businesses to store additional information that is not available in the standard Shopify fields, and gain a deeper insight into their customer base.

In this article we explore how to create, view and use Shopify metafields to segment your customers. We will cover the basics of customer metafields settings in a comprehensive guide with 4 key questions:

  • How to create customer metafields in Shopify
  • How to view customer metafields in Shopify Admin and enter data
  • How to export Shopify's customer metafields
  • How to use metafields to segment your customers

If you need to collect and display data on the store, you may jump directly to the last section How to collect metafield data directly from customers

How to create customer metafields in Shopify

  1. Go to your Shopify Admin > Settings > Custom Data. Select Customer in the metafields type, then click on the Add definition button
  2. Enter a name, description, and content type for the metafield. You probably want both the name and description to be descriptive. Type defines the type of information that the metafield can store. In most cases, a "Single line text" type would be right option to store plain text data. However you may want to get acquainted first with the other types as well, click here to learn more. For example, a boolean type (true/false) would be more approppiate to collect agreements and consets.
  3. In the Access section, make sure Storefronts is enabled.
  4. Save the changes.

How to view customer metafields in Shopify Admin and enter data

You can Pin the metafields in Shopify Admin > Settings > Custom Data > Customers so this information will be a part of the customer information that you can view from a particular customer in the Shopify Customers panel. Just go ahead and click on the pin. Then you can see these metafields in the individual Customers panels, like in the pictures below, and enter data manually.

How to view customer metafields in Shopify Admin
How to enter customer metafields data in Shopify Admin

How to export Shopify's customer metafields

In the Shopify Admin > Customers dashboard, the built-in Export feature will now allow you export all Standard and Address data, along customer tags and metafields. Shopify just added the metafields option recently in February, 2024. So once you confirm the export, you'll get all this information in a spreadsheet. Click here to find a more detailed article about this feature.

How to export Shopify's customer metafields

How to use metafields to segment your customers

Once you start collecting custom data in metafield definitions, you will be able to use it at will to address, analyze and segment your audience, thanks to the powerful segmentation built-in Shopify features.

Start by navigating to your Shopify Admin > Customers dashboard. While the regular Search Box can be used to search for emails, names, phones, locations, tags, etc., you will need to use Filters to create segments based on metafield data.

Go ahead and click on Add Filter on top. In the Filters Box you can use predefined templates or enter metafield definitions, as well as other standard data, to segment the customers. This means that you will be able to find and use the same metafields that you created before in Shopify Settings > Custom Data > Customers. Just start by writing down the word 'metafields', to list the existing customer metafields. Choose the right one based on its name.

After that you'll be able to set up one or different filters with operators (equal, not equal, greater, smaller,...), and connectors (AND/OR). You can chain different metafields and criteria, like in the picture below. If you are new to it, we recommend you having a look at Shopify's documentation to get to know more about the components of customer filters. Once you have defined your segment, click on Save Segment and name it to finish.

Shopify Segment Metafields Filters

How to collect metafield data directly from customers

Displaying already entered metafield values can be done by adding liquid code to the theme. But collecting it directly from customers requires access through API, so most likely you will need to use an app that is able to collect this data through forms that the customer will be able to submit while navigating the site.

Check on our Custom Forms plugin. Custom Forms allows you to create registration and profile forms with custom fields to collect any additional data you need from your customers. Each custom field is connected to a Shopify customer metafield, in which the data is stored and can be accessed as described above.

Froonze Registration Form
View of Froonze Custom Form on the Shopify registration page

Froonze Customer Accounts Concierge
Get the app today
Turn the account page into a beautiful portal with
Froonze Customer Accounts Concierge
  • 250+