Skip to main content

Dynamic Text Inserts

Placeholders like {points} and {currentTier} that fill storefront text with each customer's real details.

Written by Kris James

Some text fields in Mage Loyalty accept placeholders in curly brackets, such as {points}. On your storefront, each placeholder is replaced with the signed-in customer's real details, so you can write copy like "Welcome back, you have 1,250 points".

This article covers the storefront blocks: the loyalty landing page and the product page points calculator. Checkout and thank you page blocks have their own placeholders.


Where Placeholders Work

Block

Fields

Placeholders

Hero

Title and Subtitle under Logged-in state. These fields only appear after you untick Hide when logged in.

{firstName}, {points}, {store_credit}, {currentTier}

Activity Overview

Greeting Text

{points}, {store_credit}, {currentTier}, {nextTier}, {remaining}

Activity Overview

Description

{currentTier}, {nextTier}, {remaining}

Flexible Redemption

Balance message

{points}, {store_credit}

VIP Tier Benefits Table

Logged Out Title, Logged Out Subtitle, Logged In Title, Logged In Subtitle, Progress Title, Progress Subtitle

{currentTier}, {nextTier}, {remaining}, {progress}, {target}, {secondary}

PDP Points Calculator

Logged-in message, Logged-in subtext, Logged-out message, Logged-out subtext, Bonus active text

{points}, {store_credit}, {usual}, {multiplier}, {tier}, {campaign}, {end_date}

Landing page fields are in Loyalty Pages > Landing Page > Customise, then the section from the Sections list. The calculator fields are in Loyalty Pages > PDP Points Calculator > Customise.

Ways to Earn, Ways to Redeem, Your Rewards, How It Works and FAQ do not support placeholders. Anything you type in curly brackets there is shown exactly as typed.


Customer Placeholders

Placeholder

What it shows

{firstName}

The customer's first name. Example: Sarah.

{points}

The customer's points balance, for example 1,250. In store credit mode it shows as money, for example $12.50.

{store_credit}

Same value as {points}. Use whichever reads better for your program.

{currentTier}

The customer's current VIP tier name. Example: Gold.


VIP Tier Placeholders

These work in the VIP Tier Benefits Table fields. {currentTier}, {nextTier} and {remaining} also work in the Activity Overview greeting and description.

Placeholder

What it shows

{currentTier}

Current tier name. Example: Gold.

{nextTier}

Next tier name. Empty at the highest tier. Example: Platinum.

{remaining}

How much is left to reach the next tier. Example: $380 or 120.

{progress}

The customer's current progress. Example: $120 or 500.

{target}

The next tier's threshold. Empty at the highest tier. Example: $500 or 1,000.

{secondary}

What is still needed for a second tier requirement, when your tiers need two criteria. Empty when there is no second requirement or it is already met. Example: 2 more orders.

How tier values are formatted

{remaining}, {progress} and {target} follow your VIP tier entry method:

Entry method

Format

Example

Spend

Currency symbol and amount

$120

Points

Number only, so you can write your own unit word after it

500

Orders

Number only, so you can write your own unit word after it

3

In store credit mode, a points-based threshold shows as money instead. {secondary} includes its own wording, for example "$500 in spend", "2 more orders" or "100 more points".

Show a sentence only when it applies

In the four VIP Tier Benefits Table title and subtitle fields you can wrap text in these tags:

Tag

What it does

[nextTier]...[/nextTier]

Shows the text only when the customer has a tier above them

[maxTier]...[/maxTier]

Shows the text only when the customer is in the highest tier

[nextTier]Earn {remaining} more points to reach {nextTier}.[/nextTier][maxTier]You have reached our top tier![/maxTier]

Guests see neither block, because they have no tier.


PDP Points Calculator Placeholders

These work in every text field of the calculator. Bonus active text is an optional extra line that only shows while a bonus campaign is raising the amount the customer earns on that product. Leave it blank to show nothing.

Placeholder

What it shows

{points}

Points the customer earns on this product. A bonus campaign or VIP tier rate that applies to them is already included. In store credit mode it shows as money.

{store_credit}

Same value as {points}.

{usual}

The amount the customer would earn on this product without the bonus campaign, formatted like {points}. Equal to {points} when no campaign applies.

{multiplier}

The multiplier that applies to the customer, from a bonus campaign or their VIP tier. Example: 2. Shows 1 when there is none.

{tier}

The customer's VIP tier name. Points mode only. Empty for guests and for customers without a tier.

{campaign}

The bonus campaign name. Empty when no bonus campaign applies to the product.

{end_date}

When the bonus campaign ends. Examples: tomorrow, Sunday, Oct 14. On the last day it counts down, for example in 3 hours.


Bold and Italic in the Hero

The Hero Title and Subtitle fields, for both guests and signed-in customers, also accept two formatting tags:

Tag

What it does

{b}...{/b}

Makes the text bold

{i}...{/i}

Makes the text italic

Example: Join The {i}Circle{/i}. Tags can be nested, and a tag you do not close runs to the end of the text.


Examples

Field

You type

Customer sees

Hero Title (logged in)

Welcome back, {firstName}

Welcome back, Sarah

Activity Overview Greeting Text

You have {points} Points

You have 1,250 Points

Activity Overview Description

{currentTier} tier, {remaining} to {nextTier}

Gold tier, $380 to Platinum

Flexible Redemption Balance message

You have {points} points available.

You have 1,250 points available.

VIP Logged In Title

Welcome back, {currentTier} member!

Welcome back, Gold member!

VIP Progress Subtitle

Spend {remaining} more to reach {nextTier}

Spend $380 more to reach Platinum

PDP Logged-in message

Earn {points} points with this purchase

Earn 45 points with this purchase

PDP Bonus active text

Usually {usual} points · until {end_date}

Usually 45 points · until Sunday


How Placeholders Behave

  • Placeholders are case-sensitive. {currentTier} works, {CurrentTier} does not.

  • A placeholder a field does not support is shown exactly as typed.

  • Customer placeholders are meant for signed-in customers. Guests have no name or tier, so those values are empty.

  • In the VIP Tier Benefits Table, an empty placeholder is removed along with the extra space around it.

  • In the Activity Overview greeting, the word Points changes to Point when the balance is exactly 1.

  • In the PDP Points Calculator, when no bonus campaign applies, {end_date} is removed together with the separator and lead-in word before it, such as "· until".

  • On a bonus campaign's last day, a lead-in word such as "until" changes to "ends", so the line reads "ends in 3 hours".

  • In the Flexible Redemption balance message, each placeholder is only filled in the first time it appears.


Styling Placeholder Values

Some placeholders are wrapped in their own element, so you can style the value on its own with custom CSS:

Class

Where it appears

.mage-tiers-table__var

Every placeholder value in the VIP Tier Benefits titles and subtitles, in both the Table and Cards layouts

.mage-tiers-table__var--currentTier

One placeholder by name. The same pattern works for --nextTier, --remaining, --progress, --target and --secondary.

.mage-activity-overview__var--points

The balance in the Activity Overview greeting

.mage-product-points-calculator__value

The points value in the PDP Points Calculator message

/* Bold the tier name in the VIP titles */
.mage-tiers-table__var--currentTier {
font-weight: 700;
}

/* Highlight the amount still needed */
.mage-tiers-table__var--remaining {
color: #dc2626;
}

/* Bold the balance in the Activity Overview greeting */
.mage-activity-overview__var--points {
font-weight: 700;
}

Other placeholders are plain text and take the style of the text around them. See Styling your Landing Page Blocks for where to add custom CSS.

Did this answer your question?