--- title: "Using Yotpo Loyalty & Referrals Metafields in Shopify" slug: "using-yotpo-loyalty-referrals-metafields-in-shopify" description: "With Yotpo Loyalty & Referrals, essential loyalty program data is automatically synced to customer metafields in Shopify. Here's how!" tags: ["Shopify Metafields", "Loyalty and Referrals", "Shopify", "Shopify Plus"] updated: 2026-05-18T14:11:00Z published: 2026-05-18T14:11:00Z canonical: "support.yotpo.com/using-yotpo-loyalty-referrals-metafields-in-shopify" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.yotpo.com/llms.txt > Use this file to discover all available pages before exploring further. # Using Yotpo Loyalty & Referrals Metafields in Shopify 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. > [!WARNING] > Note > > If you want to stop metafield syncing, please contact your Yotpo representative or our support team. ### Compatibility - Supports both Shopify's **Legacy** and [new **Customer Accounts**](https://support.yotpo.com/docs/using-yotpo-loyalty-referrals-with-shopifys-new-customer-accounts). - Works with Yotpo’s multi-store feature. ### 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 opt-in source - Loyalty points balance - VIP tier name - VIP tier expiration date - Available rewards - Points expiration date - Points expiration enabled Learn more in the table below: | Metafield name | Namespace and key | Description | Value type | Behavior and conditions | | --- | --- | --- | --- | --- | | Yotpo Loyalty Has Shopify Account | `yotpo.loyalty_has_shopify_account` | Indicates whether the customer has a Shopify account. | Boolean `(true / false) ` | Behavior by Shopify account type: - **Legacy accounts**: Returns **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](https://support.yotpo.com/docs/using-yotpo-loyalty-referrals-with-shopifys-new-customer-accounts#%E2%80%9Conly-members-who-signed-up%E2%80%9D-optin-flow). | | 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 Opt-in Source | `yotpo.loyalty_opt_in_source` | Indicates the source where the customer first joined your loyalty program. | Single line text | Available value options: - Customer purchase (only for the "All Customers" eligibility strategy) - Referrals Program - Yotpo VIP paid-membership - Shopify Tags - Yotpo Checkout Extension - Yotpo On-site widgets - POS - Yotpo Customer Account Extension - API - Yotpo Spotlight | | Yotpo Loyalty Points Balance | `yotpo.loyalty_current_points_balance` | The customer’s current points balance. | Integer | Example values: 0, 100, -100 | | Yotpo Loyalty VIP Tier Name | `yotpo.loyalty_tier_name` | The current loyalty tier assigned to the customer (e.g., Gold, Silver), based on their status in the program. | Single Text | | | Yotpo Loyalty VIP Tier Expiration Date | `yotpo.loyalty_tier_expiration-date` | The date when the customer’s current tier expires. | ISO 8601 DateTime | Displays **N/A** if your program is set to **no expiration**. | | Yotpo Loyalty Available Rewards | `yotpo.loyalty_redeemed_awards` | A list of direct available rewards that the customer has redeemed but not yet used in a purchase. | Array (JSON objects) | It returns a list of JSON objects with the following details per customer: - Reward name from your admin (e.g., “$10 off”) - Reward type (percentage, fixed discount, etc.) - Usage status (whether it has been used in a purchase or is still available ) - Eligibility rules (e.g., minimum cart value, product restrictions defined in your program) - Redemption context (e.g., applied at checkout already: true or false) **Example value** [ { "storeId": "12345", "pointRedemptionId": 1001, "approved": true, "atCheckout": false, "codeUses": 0, "redemptionOption": { "amount": 8000, "discountType": "fixed_amount", "name": "$400 off", "type": "Coupon", "productIds": [], "variantIds": [], "collectionIds": [], "cartGreaterThanCents": 0 }, "rewardTitle": "$400 off" }, { "storeId": "12345", "pointRedemptionId": 1002, "approved": true, "atCheckout": true, "codeUses": 1, "redemptionOption": { "amount": 501, "discountType": "percentage", "name": "31% Off", "type": "Coupon", "productIds": [], "variantIds": [], "collectionIds": [], "cartGreaterThanCents": null }, "rewardTitle": "31% Off" } ] **Note**: Discount codes are not included to protect customer privacy and prevent exposure to third-party apps. | | Yotpo Loyalty Points Expiration Date | `yotpo.loyalty_nearest_points_expiration_date` | The earliest expiration date of the customer’s points, based on your program expiration rules: - If your program is set to **Date Earned**, this reflects the closest expiration date of a batch of the customer’s points. - If set to **Last Activity**, this date updates based on the customer’s most recent activity. | ISO 8601 DateTime | Displays N/A if your program is set to **no expiration**. | | Yotpo Loyalty Points Expiration Enabled | `yotpo.loyalty_points_has_expiration_period` | Indicates whether the customer’s points have an [expiration date based on the program settings](https://support.yotpo.com/docs/setting-up-points-expiration). | Boolean `(true / false) ` | | > [!WARNING] > 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 ![Yotpo loyalty customer metafields in Shopify](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/metafields-yotpo-loyalty.gif?sv=2026-02-06&spr=https&st=2026-11-18T02%3A00%3A54Z&se=2026-11-18T03%3A00%3A54Z&sr=b&sp=r&sig=YeRyohV5BK2dHmduOB8ur9haO1AwACAsjhbF6Cxt3DU%3D) 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. ![Customer metafields in the Shopify admin](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/customer-metafields-shopify-admin.png?sv=2026-02-06&spr=https&st=2026-11-18T02%3A00%3A54Z&se=2026-11-18T03%3A00%3A54Z&sr=b&sp=r&sig=QJE8zIT1lk%2FN1yIeTYlKxq%2BcZX22kr7F5V44EVpYEeU%3D) 3. You’ll see Yotpo loyalty metafields listed with their respective names and values. ![The available customer metafield definitions by Yotpo in the Shopify admin](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/image-1777287934301.png?sv=2026-02-06&spr=https&st=2026-11-18T02%3A00%3A54Z&se=2026-11-18T03%3A00%3A54Z&sr=b&sp=r&sig=d%2BJ9Mr%2B764hLsGJRHmuN9zVTyzVYFF1X5hPgZAxo8yE%3D) 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](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/yotpo-customer-metafields-example.png?sv=2026-02-06&spr=https&st=2026-11-18T02%3A00%3A54Z&se=2026-11-18T03%3A00%3A54Z&sr=b&sp=r&sig=FlDDbZjcKBOCocSht%2BWqx%2FEPjOCv66Yte6%2F4OB%2Fg1ws%3D) ## Use Cases and Examples ### 1. Create Flows with Shopify Flow Use Yotpo loyalty metafields to [create Shopify Flows](https://help.shopify.com/en/manual/shopify-flow) 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](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/shopify-flow-example.png?sv=2026-02-06&spr=https&st=2026-11-18T02%3A00%3A54Z&se=2026-11-18T03%3A00%3A54Z&sr=b&sp=r&sig=Ouc7usTOp59HX3FalndG350jB84gS%2Fh%2FCRRGitF8nEo%3D) ### 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](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/yotpo-loyalty-points-balance-metafield.png?sv=2026-02-06&spr=https&st=2026-11-18T02%3A00%3A54Z&se=2026-11-18T03%3A00%3A54Z&sr=b&sp=r&sig=zarq9N2A7b4%2B3p0n46BrmKYJvCWwiPGrZkesU8Z87mU%3D) ![Points balance example inside the Shopify cart drawer](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/shopify-cart-drawer-points-balance.png?sv=2026-02-06&spr=https&st=2026-11-18T02%3A00%3A54Z&se=2026-11-18T03%3A00%3A54Z&sr=b&sp=r&sig=iI%2F4Ugqn2EKnk4N%2BKVVEjO16dzr%2FsGF0frbnsYzpDk4%3D) ### 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](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/memebrs-exclusive-page-example.png?sv=2026-02-06&spr=https&st=2026-11-18T02%3A00%3A54Z&se=2026-11-18T03%3A00%3A54Z&sr=b&sp=r&sig=EOAI6h5SWCAycw5eR7FqAnlTpqRXXJqpxUe5OAgrdcg%3D) ### 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. > [!TIP] > Over [65% of customers prefer buying from brands they feel loyal to](https://www.yotpo.com/the-state-of-customer-loyalty-and-retention-2023/). 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](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/filter-customers-by-metafields.png?sv=2026-02-06&spr=https&st=2026-11-18T02%3A00%3A54Z&se=2026-11-18T03%3A00%3A54Z&sr=b&sp=r&sig=kHLjHaQIkMhoUiK%2FnbSqei6i2AIJOIkQ7skcABgmoJE%3D)