# Consume Group in Campaigns

The Akinon campaign system supports **two distinct consumption modes** when multiple campaigns are applied to basket items:

1. **Without Consume Group** (Condition Application Group) – Campaigns are allowed to combine freely, even if they consume the same basket items.
2. **With Consume Group** (Condition Application Group) – Campaigns are restricted to consume items sequentially within the same group, preventing overlapping usage of the same products.

A campaign is considered *combinable* if two conditions are met:

* In the **Campaign Information** tab, the **“Can be combined with other campaigns”** checkbox must be enabled.

  <figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-673b4956dbe30c36961b4333e8feceacc88e3e7c%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>
* In the **Campaign Condition** tab, the **“Condition Application Type”** must be set to **“Campaign products can be included in other campaigns.”**

  <figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-c03de54d752c30b13c05e01ef1f4e8e6dad7c535%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

Both approaches are valid and intentional. The choice depends on the business rules and how marketers want multiple campaigns to interact in practice.

To better understand these modes, let’s walk through two real-life examples. The first scenario demonstrates a simple *Buy X, Pay for Y* campaign, while the second focuses on *quantity-based percentage discounts*.

## <mark style="color:red;">**Example Basket 1 – Buy 3, Pay for 2**</mark>

* Product A × 5

The basket contains 5 items of the same product.

#### **Active Campaigns**

1. **Campaign 1**: “Buy 3, Pay for 2” *(combinable with other campaigns: checkbox enabled, condition type set to ‘Campaign products can be included in other campaigns’)*
2. **Campaign 2**: “Buy 3, Pay for 2” *(combinable with other campaigns: checkbox enabled, condition type set to ‘Campaign products can be included in other campaigns’)*

Both campaigns share the same structure and are marked as combinable.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-9d3478e94d7740ace51819ed965e942b7fe3aa8f%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

### <mark style="color:red;">**Mode 1 – Without Consume Group**</mark>

When the **Consume Group feature is not used**, campaigns marked as *combinable* can both be applied, even if they share the same condition and discount structure.

* **Campaign 1** consumes 3 of the 5 items and applies its discount.
* **Campaign 2** also consumes 3 of the 5 items and applies its discount.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-6d031b91501e8c125cf95efa5eb671f70717b618%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

**Result:** Both campaigns are applied on the same set of items. This behavior is correct in this mode because the system interprets *combinable* literally — campaigns do not block each other, and all eligible ones can be triggered simultaneously.

### <mark style="color:red;">**Mode 2 – With Consume Group**</mark>

To enable controlled consumption, the system provides **Consume Group logic**.

#### **Step 1 – Enable Dynamic Setting**

Activate the feature via `BASKET_OFFER_IS_CONSUME_GROUP_ENABLED` dynamic setting by selecting **Yes**.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-8ef8c6ad304a18c511805cdb0a3f1f7f82ca616d%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

This adds a new field, **Condition Application Group**, to the Campaign Conditions tab.

#### **Step 2 – Assign to Same Group**

For the **Consume** mechanism to take effect, the campaigns must first be explicitly assigned to the **same group** (e.g., `group1`) by giving the **Condition Application Group** field any unique identifier. Once campaigns are grouped under the same identifier, the evaluation process changes:

* The campaigns are no longer treated as independent and parallel promotions.
* Instead, they are processed **sequentially**, following the **priority values** defined for each campaign.
* The campaign with the **higher priority value** is evaluated first. If it fully consumes the applicable basket conditions, subsequent campaigns in the same group may not be triggered.
* If the first campaign only partially consumes the conditions, the system continues to evaluate the next campaign(s) in the group until all applicable conditions are exhausted.

This ensures that **only one campaign per group can be applied at a time**, unless there is remaining eligibility after the higher-priority campaign has been evaluated.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-bed376e29d0ce810e7c9b4e3cd8694346d538b7e%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Basket Evaluation with Consume Group**

**Case A – Basket with 5 Items**

* **Campaign 1** consumes 3 out of 5 items and applies its discount.
* Only 2 items remain, so **Campaign 2** cannot meet its condition.
* **Result:** Only Campaign 1 is applied.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-24275c75a896d59a9c9497be6b5868f7b7b3950a%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

**Case B – Basket with 6 Items**

* **Campaign 1** consumes 3 out of 6 items and applies its discount.
* **Campaign 2** then finds 3 items still available and applies its discount.
* **Result:** Both campaigns are applied, but only when there are enough items to satisfy both independently.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-246a8ea8cbabe57c44c5e9e439d28cb5e028d791%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

## <mark style="color:red;">**Example Basket 2 – Quantity-Based Percentage Discounts**</mark>

While the first basket scenario highlights how consume logic affects identical promotions with the same threshold, real-world campaigns often involve **tiered benefits** — for example, different discount percentages based on different quantity thresholds. The following scenario demonstrates how consume groups work in this more layered setup.

* Product A × 10
* Product B × 7\
  **Total: 17 items**

#### **Active Campaigns**

1. **Campaign 1**: Buy 10 or more items → Get **10% discount** *(combinable with other campaigns: checkbox enabled, condition type set to ‘Campaign products can be included in other campaigns’)*
2. **Campaign 2**: Buy 15 or more items → Get **20% discount** *(combinable with other campaigns: checkbox enabled, condition type set to ‘Campaign products can be included in other campaigns’)*

### <mark style="color:red;">**Mode 1 – Without Consume Group**</mark>

If no consume group is defined, both campaigns are eligible to run:

* Basket contains **17 items**, which satisfies both conditions.
* **Campaign 1** applies 10% discount.
* **Campaign 2** applies 20% discount.

**Result:** Both campaigns apply on the same basket, and the customer benefits from both discounts.

This is correct behavior in **without consume group** mode, since campaigns marked as *combinable* can overlap without restrictions.

### <mark style="color:red;">**Mode 2 – With Consume Group**</mark>

To ensure that only one campaign applies at a time, while still keeping them combinable with other unrelated campaigns, both campaigns should be placed in the same consume group (e.g., `group2`).

Additionally, the consume logic must be activated via `BASKET_OFFER_IS_CONSUME_GROUP_ENABLED` dynamic setting by selecting **Yes.** Without enabling this setting, campaigns in the same group will continue to work in parallel, regardless of group assignment.

Also, “Priority” values are used to determine which campaign should apply first.

* **Campaign 1** (10 items, 10% discount): Lower priority
* **Campaign 2** (15 items, 20% discount): Higher priority

#### **Basket Evaluation with Consume Group**

**Case A – Basket with 17 Items**

* Basket satisfies both conditions.
* Since campaigns are in the same consume group, only the **higher-priority campaign** applies.
* **Result:** 20% discount from Campaign 2 is applied, Campaign 1 is skipped.

**Case B – Basket with 25 Items**

* Basket satisfies both conditions multiple times.
* **Campaign 2** applies once for 15 items (20% discount).
* **Campaign 1** then finds another 10 items available and applies its 10% discount.
* **Result:** Both campaigns apply, but on separate sets of items, ensuring no overlap.

## <mark style="color:red;">**Comparison of the Two Modes**</mark>

<table><thead><tr><th width="193.30859375">Aspect</th><th width="221.9296875">Without Consume Group</th><th>With Consume Group</th></tr></thead><tbody><tr><td><strong>Campaign Interaction</strong></td><td>Campaigns can freely overlap</td><td>Campaigns respect group restrictions</td></tr><tr><td><strong>Item Consumption</strong></td><td>Same items can be reused by multiple campaigns</td><td>Items are consumed sequentially and cannot be reused</td></tr><tr><td><strong>Use Case</strong></td><td>Aggressive promotions, maximum stacking</td><td>Controlled promotions, fair distribution of discounts</td></tr></tbody></table>
