> For the complete documentation index, see [llms.txt](https://story.groupthought.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://story.groupthought.com/story-theme-v1/collections/badges.md).

# Badges

Add custom badges using metafields in Story 2:

![](/files/cYhR2c2CW99Jnrq2u5gS)

Each product can have a custom and unique badge when using metafields.&#x20;

### How to setup

#### TLDR;

The most important part of setting up this metafield is use the namespace and key of:

```json
theme.badge
```

See example here:

![](/files/L3Xb5z32bkwnaD1jy9xp)

### Detailed version

Start in your Shopify Admin -> Settings and choose Metafields from the left panel and then click on **Products**:

![](/files/ciMq1FK443C5tJ5wpMET)

Choose the **Add definition** button:

![](/files/Z7y7tKKPZk0RZhGi1HZz)

Next, add a Name for the metafield, any name is fine. The namespace and key **must be modified**. Be sure to change from the default entry:

![Change the default Namespace and key](/files/dwEgj0Fa8982FeOiiptG)

Change to:

{% hint style="success" %}
theme.badge
{% endhint %}

Example:

![Don't skip this step](/files/L3Xb5z32bkwnaD1jy9xp)

Add a description and choose **Select content type**.

&#x20;Choose **Text** and then **Single line text**:

![](/files/1FwbrdFM6uGhRrgPXeAP)

Single line text:

![](/files/FQj3FPakzktwC7MxeECI)

Save your new product metafield. Verify that the metafield is called:

{% hint style="success" %}
product.metafields.theme.badge
{% endhint %}

![](/files/r5OoZ0dhnWvQSZZUyRry)

### Product setup

The final step is to edit any of your products in the Shopify Admin -> Products and update the new badge metafield. Scroll to the bottom of the product setup page:

![](/files/ZfYFcv6zQFrlSA4TGOmo)

Update the Product badge metafield with the custom badge name:

![](/files/t8XwWeDoEGlHxZjaI3Fd)

Save your product and preview on any product grid view like Collection pages:

![](/files/cYhR2c2CW99Jnrq2u5gS)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://story.groupthought.com/story-theme-v1/collections/badges.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
