# Custom Badge

By default, DRIFT shows an automatic "SAVE XX%" badge on products that have a `compare_at_price` set higher than the regular price. The custom badge metafield lets you override that with your own text — useful for "NEW", "LIMITED", "RESTOCK", "MEMBERS ONLY", whatever fits your brand.

## How DRIFT picks what badge to show

DRIFT checks in this priority order:

1. **`custom.badge` metafield** — if set, this overrides everything
2. **Product tags starting with `badge:`** — e.g., a tag like `badge:NEW` shows "NEW"
3. **Auto sale badge** — if `compare_at_price > price`, shows "SAVE XX%"
4. **Nothing** — no badge at all

So the metafield is the highest priority. If you set it on a product, that's what shows up.

## Setting up the metafield

1. Shopify admin → **Settings** → **Custom data** → **Products**
2. **Add definition**
3. Fill in:
   * **Name**: Custom Badge
   * **Namespace and key**: `custom.badge`
   * **Type**: Single line text
   * **Validations**: optional (you can cap character count if you want — anything over \~12 characters starts to look cramped)
4. Save

## Using it on a product

1. Open any product in admin
2. Scroll to the **Metafields** section at the bottom
3. Find **Custom Badge**
4. Type your text (e.g., `LIMITED`)
5. Save

Refresh the storefront. The product card and PDP now show your custom badge instead of the auto sale badge.

## Tips

* **Keep it short** — 8–12 characters max. "MEMBERS ONLY DROP" wraps and looks bad. "LIMITED" looks clean.
* **All caps reads best** — DRIFT's badge styling is designed for caps. Lowercase looks softer if that's your brand though.
* **Use sparingly** — if every product has a badge, none of them stand out. Use badges on the 5–10% of products that genuinely need attention.

## When to use the tag-based approach instead

If you have a big collection of products that need the same badge (e.g., a "NEW" drop where 30 products all need "NEW"), tags are faster to manage:

* Add `badge:NEW` as a tag to all 30 products
* DRIFT renders "NEW" on all of them
* When the drop is no longer new, just remove the tag in bulk

Tags use the same priority slot — if you have BOTH a metafield AND a tag, the metafield wins.

## Removing a badge

To remove a custom badge, just clear the metafield value (delete the text). The product reverts to whatever the next priority shows — either a tag-based badge, an auto sale badge, or nothing.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webexp.dev/drift/drift-studio/metafields/badge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
