> For the complete documentation index, see [llms.txt](https://docs.samita.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.samita.io/badge-groups/set-group-conditions.md).

# Set up group conditions

Use one set of rules to control when a whole badge group appears, instead of relying on each label's own targeting.

The **Placement** tab of the group editor decides *when and where* the group appears. By default every label in the group keeps its own targeting; a group condition replaces all of it with one rule set.

## Choose a condition type

Open the group, click the **Placement** tab, and pick a **Condition type**:

| Option                               | Behavior                                                                                                          | Use it when                                                                       |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| **Keep individual label conditions** | Each label in the group is shown or hidden based on its own condition.                                            | The labels already target the right products and you only want to share a layout. |
| **Set a custom group condition**     | Overrides the individual label conditions and controls visibility using only the condition defined for the group. | The whole set belongs to one campaign — one audience, one product scope.          |

<figure><img src="https://1598842017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WRTlT5AcaLSAedbCJyZ%2Fuploads%2Fgit-blob-ceaa8e3f64ac014504e02bf6a390afda8c621f1b%2Fimage_118.png?alt=media" alt="Condition type section with the two options"><figcaption><p>Selecting Set a custom group condition reveals the condition sections below.</p></figcaption></figure>

{% hint style="warning" %}
**Set a custom group condition** ignores each label's own rules completely — not in addition to them. A label that normally shows only on sale items will appear wherever the group's condition matches.
{% endhint %}

## The condition sections

Choosing **Set a custom group condition** reveals six sections. Sections with a **chevron** (⌄) expand; **Language** and **Country** have a **switch** that must be turned on first.

| Section                 | Controls                                           |
| ----------------------- | -------------------------------------------------- |
| **Product conditions**  | Which products the group appears on                |
| **Customer conditions** | Which shoppers see it                              |
| **Page conditions**     | Which page types it appears on                     |
| **Language conditions** | The storefront language the visitor is browsing in |
| **Country conditions**  | The visitor's country                              |
| **Other conditions**    | Product image, device, and excluded theme elements |

{% hint style="info" %}
Group conditions have no scheduling or priority settings. Start and end dates stay on the individual labels — see [Schedule visibility](/badges-and-labels/schedule-visibility.md).
{% endhint %}

## Product conditions

The section starts with one row: **All Products** with the note *Enable this for all products*. Leave it as is to show the group on your whole catalog, or change the row to narrow the scope.

{% stepper %}
{% step %}

### Choose how rows combine

Set **Products must match** to **all conditions** (every row must be true) or **any condition** (one row is enough).
{% endstep %}

{% step %}

### Pick a condition

Open the first dropdown and choose a field. The list is grouped:

| Group                     | Options                                                                                                                                                                                                                                                     |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Product conditions**    | All Products, Select Products, Product title, Product type, Product vendor, Product price, Product compare price, Product sale price, Product option, Product tag, Product weight, Product created, Product published, Product inventory, Product metafield |
| **Variant conditions**    | Product variants, Variant inventory, Variant metafield                                                                                                                                                                                                      |
| **Collection conditions** | Collections                                                                                                                                                                                                                                                 |

<figure><img src="https://1598842017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WRTlT5AcaLSAedbCJyZ%2Fuploads%2Fgit-blob-ad011299384c57477f33c1e62661bf090bbd3cf4%2Fimage_119.png?alt=media" alt="Product condition dropdown showing the grouped option list"><figcaption><p>Product, variant, and collection fields all live in the same dropdown.</p></figcaption></figure>
{% endstep %}

{% step %}

### Set the operator and value

The fields beside the condition change with your choice — a text value for **Product title**, a number for **Product price**, a picker for **Select Products** or **Collections**.
{% endstep %}

{% step %}

### Add or remove rows

Click **+ Add conditions** for another row, or the trash icon at the end of a row to delete it.
{% endstep %}
{% endstepper %}

## Customer conditions

Expand **Customer conditions** and click **+ Add conditions**. A row appears with the defaults `Customer` `Is Logged In`.

| Condition                 | Targets by                                          |
| ------------------------- | --------------------------------------------------- |
| **Customer**              | Login state — **Is Logged In** or **Not Logged In** |
| **Customer tag**          | Tags on the customer record                         |
| **Customer order count**  | How many orders the customer has placed             |
| **Customer total spent**  | Lifetime spend                                      |
| **Customer purchase**     | Products the customer has bought                    |
| **Customer company name** | The company on a B2B customer record                |

<figure><img src="https://1598842017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WRTlT5AcaLSAedbCJyZ%2Fuploads%2Fgit-blob-5c57855450309a20c3e0e759d42270ae4137165b%2Fimage_120.png?alt=media" alt="Customer conditions with a condition row"><figcaption><p>Each row pairs a customer field with its own operator and value.</p></figcaption></figure>

## Page conditions

Expand **Page conditions** and click **+ Add conditions**. A row appears with the defaults `Page` `is equal to` `Index page`.

* **is equal to** — show the group only on that page type.
* **is not equal to** — show it everywhere *except* that page type.

The page types are the same ones used for individual badges (Index, Collection, Product, Article, Blog, Cart, Search, Specific pages) — see [Display by device & page](/badges-and-labels/display-device-page.md) for what each one covers.

<figure><img src="https://1598842017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WRTlT5AcaLSAedbCJyZ%2Fuploads%2Fgit-blob-46a10c846f84f3f0db880b53408312844c1f8cab%2Fimage_121.png?alt=media" alt="Page conditions row with Page, is equal to, and Index page"><figcaption><p>Add one row per page type you want to include or exclude.</p></figcaption></figure>

## Language and Country conditions

Turn on the switch on the **Language conditions** or **Country conditions** row. Each shows an **Operator** (default **Equals**) and a search field — type to find a language or country and select it.

<figure><img src="https://1598842017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WRTlT5AcaLSAedbCJyZ%2Fuploads%2Fgit-blob-4adca7450eb4690d64f9e7e53565029783a9803f%2Fimage_122.png?alt=media" alt="Language and Country conditions turned on with operator and search fields"><figcaption><p>Both sections stay inactive until you turn the switch on.</p></figcaption></figure>

{% hint style="info" %}
Language targeting relies on your store's localized versions. See [Target by country & language](/badges-and-labels/target-by-country-language.md).
{% endhint %}

## Other conditions

| Setting                    | Options                                 | Behavior                                                                             |
| -------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------ |
| **Show on (product page)** | All images / First image                | Show the group on every gallery image, or only on the first one.                     |
| **Device targeting**       | All devices / Desktop / Mobile          | Limit the group to desktop or mobile shoppers.                                       |
| **Do not show label on**   | CSS class list — `.CLASS1, .CLASS2,...` | Skip any theme element matching these classes, such as a slider or quick-view block. |

<figure><img src="https://1598842017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1WRTlT5AcaLSAedbCJyZ%2Fuploads%2Fgit-blob-47c8f7270af63d4739ab4463c49bd70db837dc09%2Fimage_123.png?alt=media" alt="Other conditions with image, device, and exclusion fields"><figcaption><p>Image, device, and exclusion settings for the whole group.</p></figcaption></figure>

## Save

Click **Save** in the top-right corner. The group appears on matching product pages immediately.

## Next steps

* [Create a label group (inside product image)](/badge-groups/create-label-group.md) — build a group that overlays the product photo.
* [Create a badge group (outside product image)](/badge-groups/create-badge-group.md) — build a group beside the product information.
* [Target products](/badges-and-labels/target-products.md) — the equivalent settings for a single badge.


---

# 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://docs.samita.io/badge-groups/set-group-conditions.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.
