Skip to main content

Targeting Products by Metafield (Variant Metafield Rule)

WHAT IS IT?

A Variant Metafield Rule lets you choose which products a campaign applies to BY A RULE instead of hand-picking them one by one. You write a condition like "any variant where "custom. material" is leather", and every matching variant is included automatically, including variants you add to your catalog later.

This is not a campaign type in its own right. It is an advanced product-scope option you turn on inside certain pricing campaigns.

WHY USE A RULE INSTEAD OF PICKING PRODUCTS?

Hand-picking products:

- You select each product/variant manually

- New matching products are NOT included

- Breaks when your catalog grows

- Hard to target a property (material, grade, season)

Variant metafield rule:

- You write one condition

- New matching variants are auto-included

- Scales with your catalog

- Targets exactly that property

If your catalog already tags variants with structured data material, grade, supplier, season, warranty length, and B2B-eligible flag, a rule automatically converts that data into pricing.

FIRST, WHAT IS A METAFIELD?

A metafield is an extra piece of structured data attached to a product or variant in Shopify, beyond the built-in fields. Each one has:

- a namespace and key (e.g., custom.material), and

- a value (e.g., leather, cotton, oak).

Real-world example: A furniture store stores each variant's wood type in "custom.material" (oak, pine, walnut) and whether it is clearance in "custom.clearance" (true/false). Those metafields can now drive pricing rules.

You define metafields in Shopify Admin → Settings → Custom data → Variants, then fill in the values on each product. The rule builder reads your existing variant metafield definitions. If the list is empty, you have not defined any yet.

WHERE IT LIVES (AND WHO CAN USE IT)

The Variant Metafield Rule appears in the product scope selector, under the "ADVANCED RULE BASED" group (next to "Price range").

It is available ONLY in these campaign types:

- Tiered Unit Pricing

- Wholesale / B2B Pricing

- Dropshipping Pricing

Plan requirement: the rule builder is a Premium-and-above feature. On lower plans, you will see an upgrade card instead of the builder.

THE CONDITION BUILDER

Each condition has three parts:

1) Metafield click to open the picker, search, and choose a definition (shown as its name with a namespace badge, e.g., "Material · custom").

2) Operator: How to compare:

- is equal to

- is not equal to

- is greater than

- is greater than or equal to

- is less than

- is less than or equal to

- contains

3) Value what to compare against (e.g., leather, true, 100).

Multiple conditions: Match ALL vs ANY

Add more conditions with "+ Add condition". When you have more than one, a selector appears:

- Match ALL: a variant must satisfy every condition (logical AND).

- Match ANY: a variant matching at least one condition is included (logical OR).

STEP-BY-STEP: USE A METAFIELD RULE IN A CAMPAIGN

Scenario used in this guide:

In a Tiered Unit Pricing campaign, apply wholesale unit prices to all leather clearance variants, every variant where "custom.material" is leather AND "custom.clearance" is true.

Step 1: Make Sure the Metafields Exist

In Shopify, confirm that you have variant metafield definitions for custom.material and custom.clearance, and that your variants have values set.

Step 2: Start a Supported Campaign

Create a Tiered Unit Pricing (or Wholesale/Dropshipping) campaign and set its pricing as usual.

Step 3: Open the Product Scope and Choose the Rule

In the Applies to / product scope selector, open the dropdown and pick "Variant metafield rule" under ADVANCED - RULE BASED.

Step 4: Build the First Condition

- Metafield: Material (custom.material)

- Operator: is equal to

- Value: leather

Step 5: Add the Second Condition

Click "+ Add condition":

- Metafield: Clearance (custom.clearance)

- Operator: is equal to

- Value: true

Set the match mode to ALL so both must be true.

Step 6: Save the Campaign

Save as usual. Every variant matching the rule now gets the campaign's pricing — and any future variant you tag the same way is included automatically.

STEP-BY-STEP: VERIFY THE RULE WORKS

Verification (match ALL):

Leather Tote – Clearance: material=leather, clearance=true → matches → priced

Leather Tote – Regular: material=leather, clearance=false → no match → not priced

Canvas Tote – Clearance: material=canvas, clearance=true → no match → not priced

Leather Wallet – Clearance: material=leather, clearance=true → matches → priced

Step 1: Check a Matching Variant

Open a leather + clearance variant. It should show the campaign price.

Step 2: Check a Non-Matching Variant

Open a leather non-clearance variant. It should keep its normal price (fails the ALL rule).

Step 3: Test "Match ANY"

Switch the match mode to ANY and re-check: now any leather variant OR any clearance variant qualifies. Confirm the set of priced variants widens accordingly.

Step 4: Add a New Matching Variant

Tag a brand-new variant with material=leather, clearance=true. Without editing the campaign, it should be picked up by the rule.

TIPS & COMMON MISTAKES

- Empty metafield list? You have not defined any variant metafields in Shopify yet, or your plan does not include the feature. Define them under Settings → Custom data → Variants first.

- Values must match exactly. "True" is not "true", and a stray space will not match. Keep your metafield values consistent.

- ALL vs ANY is the most common mistake. "leather AND clearance" (ALL) is a narrow set; "leather OR clearance" (ANY) is much wider. Double-check which you meant.

- Numeric operators need numeric metafields. Use "is greater than" / "is less than" on number-typed metafields (e.g., warranty months >= 24), not on free text.

- Premium feature. On plans below Premium, the builder is replaced by an upgrade card.

- Rule and manual do not mix on one scope. The rule defines the whole included set; to fine-tune, adjust the conditions rather than expecting a separate hand-picked list.

Did this answer your question?