Skip to main content

Getting Started

Written by Kris - Mage Loyalty
Updated over 2 weeks ago

Mage automatically makes your loyalty program data available in your Shopify theme through metafields. This means you can display points balances, rewards, VIP tiers, and more anywhere in your liquid files.

What Data Is Available?

Mage provides two metafields:

Metafield

What It Contains

shop.metafields.mage.loyalty

Your loyalty program settings — earning rules, rewards, VIP tiers, referral program, and points expiry settings.

customer.metafields.mage.loyalty

The logged-in customer's loyalty data — points balance, lifetime points, VIP tier, and membership status.

How To Use Them

You access metafields in your Shopify theme files (.liquid files) using Liquid tags.

Here's a quick example:

{% assign loyalty = shop.metafields.mage.loyalty.value %}
{% if loyalty.points_program.enabled %}
<p>Our loyalty program is active!</p>
{% endif %}

And for customer data:

{% if customer %}
{% assign loyalty = customer.metafields.mage.loyalty.value %}
{% if loyalty %}
<p>You have {{ loyalty.points_balance }} points</p>
{% endif %}
{% endif %}

Note: Customer metafields are only available when a customer is logged in. Always wrap customer metafield code in {% if customer %} to avoid errors for guest visitors.

When Does The Data Update?

  • Shop metafield updates whenever you change any loyalty program setting — toggling programs, creating/editing/deleting earning rules, rewards, or VIP tiers.

  • Customer metafield updates whenever a customer's loyalty data changes — earning points from a purchase, redeeming a reward, changing VIP tier, or having points manually adjusted.

Where Can I Use This?

You can use metafields in any .liquid file in your theme, some examples include:

  • Sections — Build custom loyalty sections for your homepage or landing pages

  • Snippets — Create reusable loyalty components (e.g. a points balance badge)

  • Templates — Show loyalty info on product pages, cart, or account pages

  • Header/Footer — Display a points balance in your site navigation

Do I Need To Enable Anything?

No. Metafields are automatically active for all Mage stores. There's nothing to configure.

Next Steps

Did this answer your question?