Skip to main content

Dynamic Product Metafields

Dynamic Product Metafields automatically label your Shopify products based on how they actually perform. You write a rule once, like "high gross profit and in stock." ProfitPeak then keeps a matching label on every product variant that qualifies and updates it as performance changes. Your collections, discounts, storefront, and ad feeds can all use those labels, so your merchandising and advertising follow profit without anyone retagging products by hand.

Why use profit-based product labels?

Most stores still decide which products to advertise, feature, or discount from a spreadsheet or someone's gut feel, then tag products by hand. Those tags go stale quickly. A product that was a winner last month keeps its budget after returns start climbing, while a new hit goes unnoticed until someone updates the list.

Think of it like the "Best Seller" and "Clearance" signs in a supermarket. Normally, someone has to walk the aisles every week and move them. Dynamic Product Metafields do that job for you, working from your live profit data. The signs move every time the numbers change, so your ads, collections, and discounts always point at the right products.

What are Dynamic Product Metafields?

A metafield is a custom piece of information stored on a product in Shopify, such as a label, a date, or a number. Shopify and the tools connected to it can read metafields to decide which products belong in a collection, a discount, or an ad campaign.

Dynamic Product Metafields are metafields that ProfitPeak creates and keeps updated for you, based on rules you set. Three things make them useful:

  • They're based on profit. Rules use metrics like gross profit, net profit, net sales, stock, and refund rate, not just revenue.

  • They stay current. Each rule looks back over a period you choose, such as the last 30 days, and products move in or out of a label as their performance changes.

  • They're standard Shopify metafields. Anything that reads Shopify data can use them, including smart collections, automatic discounts, your storefront theme, and your Google, Meta, Pinterest, and TikTok product feeds. There's nothing new to learn.

How do Dynamic Product Metafields work?

Every rule follows the same four-step cycle, which repeats automatically:

  1. Score. Product Intelligence calculates sales, profit, stock, and refund metrics for each variant over the rule's lookback period. It also ranks each product into a class: Winners, Contenders, Underperforming, or Dead.

  2. Match. Your rule checks each variant against its conditions and removes any that hit an exclusion.

  3. Label. ProfitPeak writes the rule's metafield to each matching variant in Shopify, for example a_class = A Class.

  4. Use. Shopify and your feeds read the metafield. A Google campaign built on "A Class" now contains exactly your current winners.

When a product's performance changes, the cycle picks it up. You never have to rebuild a collection or campaign by hand when a product heats up or cools off.

What goes into a rule?

Each rule appears as a row on the Dynamic Product Metafields page. The fields you'll set are:

Field

What it means

Example

Metafield Name

The label you see in ProfitPeak and Shopify

A Class

Metafield Key

The identifier Shopify stores, written in lowercase with underscores

a_class

Metafield Value

The value written to each matching variant

A Class

Lookback Days

How many days of data the rule checks

30

Shopify Type

Where the metafield is saved. Leave this as PRODUCTVARIANT so each size or color is labeled on its own.

PRODUCTVARIANT

Why are rules applied to variants instead of whole products?

Performance often varies by size or color. Labeling variants lets you advertise the sizes that sell and hold back the ones that don't, even within the same product.

What are the product classes?

Product Intelligence sorts products into four classes. You can base them on gross profit, net profit, or net sales, and use any class as a rule condition.

Class

Nickname

What it means

A

Winners

High profit and steady sales, roughly the top 70%

B

Contenders

Reasonable profit and good sales, roughly the next 20%

C

Underperforming

Lower returns, roughly the last 10%

D

Dead

Negative profit or stock that isn't moving

How do conditions and exclusions work?

Conditions decide which products are included. For example: Product Gross Profit Class is equal to Winners (A).

Exclusions decide which products are kept out. A product is removed if it matches any exclusion. For example, it's a gift card, or it's out of stock, or its refund rate is above your store average.

What can you use Dynamic Product Metafields for?

Goal

Rule idea

Where you'd use it

Put more ad spend behind your best products

A Class by gross profit, in stock, normal refund rate

Google Shopping or Performance Max, Meta Advantage+ catalog

Give mid-performers a push

B Class (Contenders)

A medium-budget campaign or a homepage collection

Stop wasting spend on dead stock

D Class, or "Zombie" products with very low traffic and sales

Exclude from main campaigns, add to a clearance collection

Clear aged or low-margin stock profitably

Low margin, high stock, older than a set number of days

An always-on clearance campaign or automatic discount

Promote what's new

Added to "New Arrivals" in the last 90 days

A new-in collection or launch campaign

Protect profit on paid media

Gross profit return on ad spend (PROAS) above a minimum

A minimum-PROAS campaign

Sell through broken size runs

Only a few variants left in stock ("fringe sizes")

A low-budget fringe-size campaign or email

Split a catalog with big margin differences

Gross, contribution, or net profit tiers

Tiered campaigns with different ROAS targets

In every case, your merchandising and ad setup follows profit automatically, instead of depending on whoever last tagged products by hand.

How do you set up Dynamic Product Metafields?

Part 1: Create a rule in ProfitPeak

  1. Open Dynamic Product Metafields. You'll see a table of your existing rules.

  2. Start a new rule.

  3. Name the metafield.

    • Metafield Name: A clear label, like A Class.

    • Metafield Key: Lowercase with underscores, like a_class. Choose carefully, because Shopify, your theme, and your feeds will all refer to it.

    • Metafield Value: The value matching variants receive, like A Class.

  4. Set the Lookback Days. Use 30 days for fast-moving catalogs and 60 to 90 days for slower or seasonal ones. Shorter windows react faster. Longer windows are more stable.

  5. Confirm the Shopify Type. Leave it as PRODUCTVARIANT.

  6. Add your conditions. For example: Product Gross Profit Class is equal to Winners (A).

  7. Add exclusions. Remember that any single match removes the product. Common exclusions include:

    • Inactive products

    • Gift cards

    • Stock below 1

    • Product types you don't advertise, like samples or packaging

    • Refund rate above your store average

  8. Save the rule. ProfitPeak starts writing the metafield to matching variants in Shopify.

  9. Check the result. In Shopify admin, open a product you expect to match. You should see your key and value in the variant's metafields.

Part 2: Use the metafield in Shopify

  1. Smart collections. In Shopify admin, go to Products → Collections → Create collection and choose Automated. Add a condition on your metafield, for example a_class is equal to A Class. The metafield needs to be enabled for automated collections in Shopify first.

  2. Automatic discounts. Point a discount at the smart collection, such as 20% off a Clearance collection.

  3. Storefront. Your theme can read the metafield to show badges like "Best Seller" or "New In."

Part 3: Use the metafield in your product feeds

  1. In ProfitPeak, go to Automation → Feed Management.

  2. Open an existing channel, or click Add channel and choose Google, Meta, Pinterest, or TikTok.

  3. On the Mapping tab, map your metafield to a custom label, for example custom_label_0 = a_class. Custom labels aren't visible to shoppers, but you can group campaigns by them.

  4. If you want, use the Filter tab to include or exclude products by metafield. For example, you could keep D Class products out of a feed entirely.

  5. Click Save changes, then Resync Feed to publish.

  6. In Google Ads or Meta, build or split campaigns by that custom label, with one campaign or asset group for A Class, another for B Class, and so on.

What do example rules look like?

These are starting points you can copy and adjust.

Rule

Key and value

Lookback

Include when

Exclude when (any)

A Class (Winners)

a_class = A Class

30 days

Product Gross Profit Class is Winners (A)

Inactive, gift card, stock below 1, excluded product types, refund rate above store average

B Class (Contenders)

b_class = B Class

30 days

Product Gross Profit Class is Contenders (B)

Same as A Class

New Arrivals

new_arrival = New Arrival

90 days

Added to "New Arrivals" in the last 90 days

Inactive, gift card, stock below 1

Clearance

clearance = Clearance

90 days

Product Gross Profit Class is Underperforming (C) or Dead (D), and stock is high

Gift card, last remaining variants, products you'd rather clear by email

What does this look like in practice?

Northwind Outdoor, a fictional brand, sells 400 variants. They create the A Class rule above and map a_class to custom_label_0 in their Google feed. Then they split Performance Max into two asset groups. A Class gets the bigger budget, and everything else runs with a tighter ROAS target.

Later, one of their jackets starts getting returned more often, and its refund rate climbs above the store average. On the next update, it drops out of A Class and leaves the high-budget asset group. Nobody had to touch the campaign.

What are the best practices?

Start with two or three rules. A Class, D Class, and New Arrivals cover most first campaigns. Add more tiers once those are running.

Keep your keys stable. Renaming a key breaks every collection, theme badge, and feed mapping that uses it. If a rule needs to change, change its conditions instead.

Always exclude the basics. Leave out gift cards, inactive products, and out-of-stock variants so you're not paying for clicks you can't convert.

Match the lookback to your buying cycle. Use 30 days for fast fashion or consumables, and 60 to 90 days for furniture, jewelry, or seasonal ranges.

Ask Sherpa to help set thresholds. Before building a rule, ask Sherpa what margin, stock, or refund cutoff separates your winners from the rest.

Review monthly. Check how many variants each rule labels. If A Class covers half your catalog, tighten the conditions.

Did this answer your question?