Rule-based badges from feed data

Make badges that compute themselves from your feed. Show an automatic percent-off, display a badge only on discounted or specific products, and target overlays with product sets, all driven by your live product data.

Rule-based badges from feed data

Badges driven by your data

Rule-based badges turn your feed data into creative. Instead of typing a fixed value, you use tokens and rules so each product's badge reflects its own price, discount, and attributes, computed fresh on every sync.

Two mechanisms work together: tokens fill in the badge text from product values, and rules decide which products get the overlay at all.

Tokens: automatic values in the text

Badge and text layers support tokens wrapped in braces. The most useful is {discount}, which becomes the product's computed percent off (derived from sale price versus regular price). You can also use {price}.

So a badge text of "{discount}% OFF" renders "30% OFF" on a product at 30 percent off, with no per-product editing. A token with no value for a product simply renders as empty.

  • {discount} = computed percent off (only meaningful when the product is on sale).
  • {price} = the product price.
  • Mix tokens with plain text, like "SAVE {discount}%".

Show a badge only on the right products

There are two layers of rules. A layer-level visibility condition controls whether a specific badge draws, and a template-level targeting rule controls whether the template wins a product at all. A default sale badge uses both: it only wins discounted products, and the badge layer only draws when discount is greater than 0.

This pairing matters: it stops a sale badge from claiming a full-price product (where it would draw nothing) and shadowing a lower-priority template that should have applied instead.

Target overlays with product sets

For richer targeting, point a template's "Applies to" rule at a saved product set. That lets you reuse a group you already defined, like "Clearance (40%+ off)" or "Premium brands," instead of re-typing conditions in the template.

Combine this with priority to layer campaigns: a clearance template at high priority, a general sale template below it, so each product gets the most specific badge that applies.

  1. 1Define the product set you want to badge (see Create product sets with rules).
  2. 2In the Creative studio, open or create a template.
  3. 3Set "Applies to" to a rule referencing that set.
  4. 4Set the badge text with tokens like {discount}% OFF.
  5. 5Give it a priority so it wins over more general templates, then Save.

Gotchas to avoid

Watch the "Applies to N of M products" count. A rule that matches nothing means no images get badged, even though the template looks correct. Loosen the conditions until the count is what you expect.

Remember the channel policy: badged images go only to Meta, TikTok, Snapchat, and Pinterest. Google Shopping and Microsoft always receive the clean original, so a promo overlay cannot trigger a disapproval there. Plan your discount and promo badges with social channels as the audience.

Questions

How do I show an automatic percent-off?

Use the {discount} token in the badge text, for example "{discount}% OFF." MartechFlow computes each product's percent off from its sale price versus regular price and fills it in at render time.

How do I badge only products on sale?

Target the template at "discount is greater than 0" (or use the built-in sale setup). The badge then renders only on products with a real discount, and other products keep their original image.

Can I badge only one brand or category?

Yes. Build a product set for that brand or category, then set the template's "Applies to" rule to reference that set. The badge applies only to matching products.

Why is nothing getting badged even though I saved a template?

Its targeting rule probably matches zero products, or the feed has not run yet. Check the live match count and loosen the rule, and make sure the feed has synced so product data exists to evaluate.

Ready to try it?

Start free, no credit card. Your first feed can be live in minutes.

Start free