Using Yotpo Loyalty & Referrals Metafields in Shopify

Prev Next

Products


Loyalty & Referrals

Supported plans

Pro, Premium, Enterprise

eCommerce Platform

Shopify, Shopify Plus

Goals and Outcomes

Shopify metafields allow you to store and display custom data across your store, including on customers, products, and orders. With Yotpo Loyalty & Referrals, essential loyalty program data is automatically synced to customer metafields in Shopify. This gives you greater visibility and control over your loyalty data while enabling more personalized shopping experiences and smarter automation.

In this article, you’ll learn:

  • What Yotpo loyalty data is available as metafields in Shopify

  • How to access and manage these metafields in the Shopify admin

  • Examples of using loyalty metafields to support your business strategy

Yotpo Loyalty Data as Metafields

Yotpo loyalty metafields are available to all merchants on Pro, Premium, and Enterprise plans with an active loyalty program. These metafields are automatically added to customer profiles and synced in real-time between Yotpo and Shopify.

Note

If you want to stop metafield syncing, please contact your Yotpo representative or our support team.

Compatibility

Yotpo Loyalty Metafields

The following core loyalty data is saved and available as customer metafields in Shopify:

  • Shopify account

  • Loyalty opt-in

  • Loyalty opt-in date

  • Loyalty points balance

Learn more in the table below:

Metafield name

Namespace and key

Description

Value type

Behavior by  Shopify account type

Yotpo Loyalty Has Shopify Account

yotpo.loyalty_has_shopify_account

Indicates whether the customer has a Shopify account.

Boolean

(true / false)

Legacy accounts: Shows True if the customer has a Shopify account, and False if they don’t.

Customer Accounts: The value is False by default since there is no account creation.

Yotpo Loyalty Opt-in

yotpo.loyalty_opt_in

Indicates if the customer is opted into your loyalty program.

Boolean

(true / false)

Based on your program’s opt-in strategy:

“All customers” - customers are automatically enrolled, so "True" will appear after a customer record is created in Shopify, for both new Customer Accounts and Legacy accounts.

“Only members who signed up” - it depends your Shopify account type:

  • For Legacy accounts: if the shopper has created an account in Shopify (meaning the account status is set to true).

  • For Customer Accounts - customers are enrolled after they agree to become members and join the program through the consent checkbox.

Yotpo Opt-in Date

yotpo.loyalty_opt_in_date

Timestamp of when the customer opted into the loyalty program.

ISO 8601 DateTime

Displays N/A if the customer is not opted in.

Yotpo Loyalty Points Balance

yotpo.loyalty_current_points_balance

The customer’s current points balance.

Integer

Example: 0, 100, -100

Important

  • You can edit metafield values, however, we strongly recommend not making manual changes (for example, to a customer’s opt-in status or points balance). Yotpo is the source of truth for loyalty data, and any edits made directly in Shopify will not sync back to Yotpo, which can cause data discrepancies between your Yotpo admin and your Shopify store.

  • You can pin and unpin metafields for quick use.

  • All metafields follow a unified format using a namespace and key to ensure uniqueness, e.g., app--123456789--loyalty_opt_in.

Viewing Metafields in the Shopify Admin

Viewing metafields in Shopify

To view Yotpo loyalty metafields in your Shopify admin:

  1. From your Shopify Admin, go to Settings.

  2. Select Metafields and metaobjects and click the Customers definition.

    The Customers metafield definitions in Shopify

  3. You’ll see Yotpo loyalty metafields listed with their respective names and values.

    Yotpo Loyalty customer metafield definitions in the Shopify admin

  4. To view data for a specific customer, go to Customers, select a customer, and scroll down to the Metafields section.

    Yotpo loyalty customer metafields example

Use Cases and Examples

1. Create Flows with Shopify Flow

Use Yotpo loyalty metafields to create Shopify Flows and trigger automations.

Example: Send a post-purchase marketing email to loyalty members (using the yotpo.loyalty_opt_in metafield) after they place an order.

Shopify Flow example

2. Show a Customer’s Points Balance in the Shopify Cart Drawer

You can display a customer’s current loyalty points balance directly inside the Shopify cart drawer (mini cart/side cart). This helps drive engagement and speeds up the path to checkout by reminding shoppers of the value they’ve already earned.

Implementation example:

To implement this in your store, use the code snippet below.

Make sure to replace the placeholder (######) with the number shown in your customer metafield definition, as it appears under the namespace and key in your Shopify admin.

{% if customer %}

    <div class="yotpo-container">

      {% if customer.metafields.app–######--yotpo.loyalty_opt_in == true  %}

      <div class="yotpo-points-tier-standalone">

      You have {{ customer.metafields.app--######--yotpo.loyalty_current_points_balance }} pts

      </div>

        {% endif %}

    </div>

  {% endif %}

Yotpo Loyalty points balance metafield

Points balance example inside the Shopify cart drawer

3. Show Exclusive Page

Customize your storefront experience and build exclusivity based on loyalty membership.

Implementation example:

Hidden page for exclusive members only.

To implement this in your store, use the code snippet below.

Make sure to replace the placeholder (######) with the number shown in your customer metafield definition, as it appears under the namespace and key in your Shopify admin.

{% if customer %}

 {% if customer.metafields.app--(######)--yotpo.loyalty_opt_in == true  %}

   <!-- CONTENT FOR CUSTOMER IS LOGGED IN AND OPTED IN -->

 {% else %}

   <!-- CONTENT FOR CUSTOMER IS LOGGED IN AND OPTED OUT -->

  {% endif %}

{% else %}

 <!-- CONTENT FOR CUSTOMER IS LOGGED OUT -->

{% endif %}

An example of a members exclusive page

4. Show Dynamic Messaging or Pricing Based on Loyalty Status

Customize your storefront experience and build exclusivity based on loyalty membership.

Example: Show members-only pricing or promos based on loyalty status (yotpo.loyalty_opt_in = true), along with a message like “Welcome back! As a member, you save 15% on this item.”

5. Personalize Product Pages with Loyalty Data

Boost product page conversion by showcasing social proof from your loyalty program.

Example: Display the number of loyalty members who bought a product directly on the product page (e.g., “15 loyalty members bought this in the last 30 days”) to encourage purchases through FOMO and trust.

Over 65% of customers prefer buying from brands they feel loyal to. Showcasing loyalty insights helps strengthen that connection and boost repeat purchases.

6. Using Metafields Within Shopify's Filtering Tool

Enhance your Shopify customer segments with Loyalty data powered by metafields.

For example, create a segment to identify how many Loyalty members have a current points balance greater than or equal to the minimum required for your first reward redemption:

  1. Go to Customers in your Shopify admin.

  2. Click Create Segment or Add Filter.

  3. Enter the relevant metafields.

Example of filtering customers by metafields