How to use customer metafields in your blocks
Learn how to display customer metafield values in block text with {{ namespace.key }} tokens, with examples and fallbacks.
You can display customer-specific values inside any block’s text using metafield tokens. Each signed-in customer sees their own value.
How it works
Write a token in the format {{ namespace.key }} in any text field of your block — titles, body text, rich text. When a customer views their account page, the token is replaced with the value of that customer metafield.
Example. A block with the text:
Your loyalty tier: {{ loyalty.tier }}
renders for a customer whose loyalty.tier metafield is “Gold” as:
Your loyalty tier: Gold
Finding the namespace and key
In your Shopify admin, go to Settings → Custom data → Customers. Each metafield definition shows its namespace and key, e.g. custom.birthday or loyalty.tier. Use exactly that, joined with a dot, inside the braces.
Good to know
- Missing values render as empty text. If a customer has no value for the metafield, the token is removed — customers never see the raw {{ … }} text. If a half-empty sentence would look odd, add a visibility condition on the same metafield so the block only shows when the value exists.
- Customer metafields only. Shop or order metafields aren’t supported in block text.
- Spacing doesn’t matter. {{loyalty.tier}} and {{ loyalty.tier }} both work.
- Values display as plain text. The stored value is inserted as-is; text-type metafields work best.
- Works with translations. Tokens inside translated content resolve the same way.
- Available on the Starter plan and up.
Was this article helpful?
Thanks for your feedback!