Shopify Metafields & Metaobjects Overview
memberr uses Shopify's metafields and metaobjects to store and manage various types of data.
This documentation provides a comprehensive overview of how these systems work together.
Metafields store simple, single-value data points:
Metaobjects store complex, structured data that of multiple fields:
Metafields vs. Metaobjects
Metafields | Metaobjects |
---|
Single-value data storage | Complex, multi-field data structures |
Simple types (text, number, money, JSON) | Can reference other metaobjects |
Attached to existing Shopify resources (shop, customer) | Stand-alone entities |
Used for configuration and customer-specific data | Used for program configurations and complex data relationships |
_10{{ shop.metafields.app--60169453569--memberr_v2.organization_id }}
_10{%- assign membership = shop.metaobjects.app--60169453569--membership.v2 -%}
- Shop Configuration:
_10{{ shop.metafields.app--60169453569--memberr_v2.FIELD_NAME }}
- Customer Data:
_10{{ customer.metafields.app--60169453569--memberr_v2.FIELD_NAME }}
- Program Configuration:
_10{%- assign program = shop.metaobjects.app--60169453569--PROGRAM_TYPE.v2 -%}
- Always check existence before accessing:
_10{% if shop.metafields.app--60169453569--memberr_v2.field_name %}
_10 <!-- Access field -->
- Handle money values correctly:
_10{{ money_field.value | money }}
- Use proper namespace:
_10app--60169453569--memberr_v2
Field Name | Type |
---|
text | Text values |
money | Monetary values |
json | Structured data |
boolean | true/false values |
Field Name | Type |
---|
is_active | Program activation status |
membership_id | References to memberships |
Money amounts | always use .value to access |
Time periods | in days |
- Some fields are publicly readable
- Sensitive data is restricted
- Always check access levels in documentation
- Customer metafields are scoped to individual customers
- Membership data is properly segmented
- Balances are securely managed
- Start with Shop Metafields for basic configuration
- Understand Customer Metafields for user data
- Explore individual program documentation for specific features
- Reference best practices when implementing
- Check individual documentation pages for detailed examples
- Follow best practices for each data type
- Ensure proper error handling in your implementation
- Contact support for additional assistance