Home

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.

Quick Navigation

Metafields

Metafields store simple, single-value data points:

Metaobjects

Metaobjects store complex, structured data with multiple fields:

Understanding the Architecture

Metafields vs Metaobjects

Metafields

  • Single-value data storage
  • Simple types (text, number, money, JSON)
  • Attached to existing Shopify resources (shop, customer)
  • Used for configuration and customer-specific data

Example of a metafield:


_10
{{ shop.metafields.app--60169453569--memberr_v2.organization_id }}

Metaobjects

  • Complex, multi-field data structures
  • Can reference other metaobjects
  • Stand-alone entities
  • Used for program configurations and complex data relationships

Example of a metaobject:


_10
{%- assign membership = shop.metaobjects.app--60169453569--membership.v2 -%}

Common Patterns

Accessing Data

  1. Shop Configuration:

_10
{{ shop.metafields.app--60169453569--memberr_v2.FIELD_NAME }}

  1. Customer Data:

_10
{{ customer.metafields.app--60169453569--memberr_v2.FIELD_NAME }}

  1. Program Configuration:

_10
{%- assign program = shop.metaobjects.app--60169453569--PROGRAM_TYPE.v2 -%}

Best Practices

  1. Always check existence before accessing:

_10
{% if shop.metafields.app--60169453569--memberr_v2.field_name %}
_10
<!-- Access field -->
_10
{% endif %}

  1. Handle money values correctly:

_10
{{ money_field.value | money }}

  1. Use proper namespace:

_10
app--60169453569--memberr_v2

Data Types

Common Metafield Types

  • text - Simple text values
  • money - Monetary values
  • json - Structured data
  • boolean - True/false values

Common Metaobject Fields

  • is_active - Program activation status
  • membership_id - References to memberships
  • Money amounts (always use .value)
  • Time periods (in days)

Security Considerations

  1. Public vs Private Access
  • Some fields are publicly readable
  • Sensitive data is restricted
  • Always check access levels in documentation
  1. Customer Data Protection
  • Customer metafields are scoped to individual customers
  • Membership data is properly segmented
  • Balances are securely managed

Getting Started

  1. Start with Shop Metafields for basic configuration
  2. Understand Customer Metafields for user data
  3. Explore individual program documentation for specific features
  4. Reference best practices when implementing

Need Help?

  • 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