> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 高度なマーチャンダイジングルールを定義する

> アルゴリズム、条件、フィルタを連鎖させて、レコメンデーションブロックに表示される商品を制御する高度なマーチャンダイジングロジックを構築します。

<Note>
  これはプレミアム機能です。Kameleoon アカウントで有効化するには、カスタマーサクセスマネージャーにお問い合わせください。
</Note>

Kameleoon では、訪問者に推奨される商品を決定する高度なマーチャンダイジングルールを定義できます。次のことが可能です。

* 組み込みの **algorithms** を活用して、レコメンデーションに表示される商品を選択します。
* **conditions** を適用して、どのアルゴリズムを実行するかを決定します。
* **filters** を適用して、各アルゴリズムが返す商品を絞り込みます。

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/recommendations-and-merchandising/recommendations/define-advanced-merchandising-rules/rules.png)
</Frame>

設定画面の上部には、ブロックの名前、説明、およびそのブロックに表示される商品の最大数が表示されます。

ブロックは次のように設定できます。

* ブロックのタイトルを変更する。
* アルゴリズムとフィルタを組み合わせる。
* 複雑なシナリオを設定する。

## ビルダーとルールの概要

マーチャンダイジングルールビルダーを使用すると、**algorithms**、**conditions**、**actions** を連鎖させることができます。

<Note>
  Kameleoon はルールを上から下に評価します。あるブロックのルールに一致する商品が十分にない場合、Kameleoon は次のブロックに移動します。
</Note>

**+** をクリックして、条件またはアクションを追加します。

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/recommendations-and-merchandising/recommendations/define-advanced-merchandising-rules/0.png)
</Frame>

次に、3 つのオプションがあります。

* **Action** — アプリに表示される商品レコメンデーションブロック全体の名前を変更するなどの操作を実行します。
* **Condition** — どのアルゴリズムを実行するかを決定するロジックを定義します。
* **Algorithm** — 組み込みのレコメンデーションアルゴリズムを選択し、それにフィルタを適用します。

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/recommendations-and-merchandising/recommendations/define-advanced-merchandising-rules/1.png)
</Frame>

### Actions

* **Change block title** でブロックの名前を変更します。
* **Sort products** でアルゴリズムが返す商品を異なるロジック（例：価格、それらの商品の注文数、評価）に基づいてソートします。

### Conditions と Filters の違い

Conditions と filters は異なる目的を持ちます。

| 概念            | 目的                              | 例                                                                        |
| ------------- | ------------------------------- | ------------------------------------------------------------------------ |
| **Condition** | 論理ルールに基づいてどのアルゴリズムを実行するかを定義します。 | *現在の商品の価格が \$20 の場合、アルゴリズム A を実行する。それ以外の場合、アルゴリズム B を実行する。*              |
| **Filter**    | アルゴリズムが返す商品を絞り込みます。             | *「Popular products」アルゴリズムを適用するが、ユーザーが購入したカテゴリの商品のみを表示するように結果をフィルタリングする。* |

#### Conditions

条件を追加するには:

1. **+** アイコンをクリック > **Condition**。
2. [利用可能な条件タイプ](#available-conditions)から選択します。

条件は AND/OR で組み合わせることができます。

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/recommendations-and-merchandising/recommendations/define-advanced-merchandising-rules/2.png)
</Frame>

<Note>
  「上から下」のロジックにより、条件は次のアルゴリズム（条件の下のアルゴリズム）に適用されます。例えば、下の画像では、商品が \$100 を超え、カートに入っている場合、ユーザーには他の人気商品が表示されます。そうでない場合、ユーザーには類似商品が表示されます。
</Note>

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/recommendations-and-merchandising/recommendations/define-advanced-merchandising-rules/3.png)
</Frame>

##### 利用可能な条件

| カテゴリ                     | 条件                                                  | 説明                               |
| ------------------------ | --------------------------------------------------- | -------------------------------- |
| **Product and category** | Are there any products in the cart?                 | 訪問者のカートに商品があるかどうかを確認します。         |
|                          | Current cost of items in the cart                   | カートの合計値を評価します。                   |
|                          | Current product's price                             | 現在の商品の価格に基づいてターゲティングします。         |
|                          | Current product already in cart?                    | 現在の商品が既に訪問者のカートにあるかどうかを確認します。    |
|                          | Current product ID                                  | 特定の商品 ID と一致させます。                |
|                          | Current product's brand is                          | 現在の商品のブランドと一致させます。               |
|                          | Current category contains                           | 現在のカテゴリにキーワードが含まれている場合に一致します。    |
|                          | Current category equals                             | 特定のカテゴリと一致させます。                  |
|                          | Current product belongs to category                 | 特定のカテゴリと一致させます。                  |
|                          | Have products in the cart from category             | 訪問者が特定のカテゴリの商品を追加したかを確認します。      |
|                          | Have products in the cart from current category     | 訪問者が現在のカテゴリの商品を追加したかを確認します。      |
|                          | Current product has the parameter                   | 特定の属性またはパラメータを含む商品をターゲットにします。    |
| **Actions**              | User bought something within the period (in days)   | 定義された期間内に購入した訪問者をターゲットにします。      |
|                          | How many times purchased during the selected period | 購入頻度を評価します。                      |
|                          | Opened a product "out of stock"                     | 訪問者が在庫切れ商品を見たかを確認します。            |
|                          | Opened a product from the categories                | カテゴリ別の商品閲覧で一致させます。               |
|                          | Added a product from the categories to the cart     | 特定のカテゴリからのカート追加に基づいてターゲットにします。   |
|                          | Bought a product from the categories                | 特定のカテゴリの購入に基づいてターゲットにします。        |
|                          | Opened a product                                    | 訪問者がいずれかの商品ページを開いたかを確認します。       |
|                          | Added specific product to cart                      | 特定の商品がカートに追加されたことに基づいてターゲットにします。 |
|                          | Bought a product                                    | 訪問者が購入を完了したかを確認します。              |
|                          | Opened a product from the brand                     | あるブランドの商品閲覧に基づいて一致させます。          |
|                          | Added a product from the brands                     | 特定のブランドからのカート追加に基づいてターゲットにします。   |
|                          | Bought a product from the brand                     | あるブランドからの購入に基づいてターゲットにします。       |

#### Filters

フィルタは、アルゴリズムが返す商品を絞り込みます。

フィルタを追加するには:

1. **algorithm** にホバー > **歯車アイコン** をクリックします。
2. **Add filter** を選択します。
3. 必要なフィルタを選択し、そのパラメータを設定します。

1 つのアルゴリズムに複数のフィルタを適用できます。

##### 利用可能なフィルタ

| フィルタ                                                                        | 説明                              |
| --------------------------------------------------------------------------- | ------------------------------- |
| Show products only from selected categories                                 | 選択したカテゴリに結果を制限します。              |
| Don't show products from selected categories                                | 特定のカテゴリを除外します。                  |
| Show only products from the category of the current product                 | 結果を現在の商品のカテゴリに制限します。            |
| Show from categories in which the user has viewed products                  | 訪問者が閲覧したカテゴリの商品を表示します。          |
| Show products from categories the user has added to cart                    | 訪問者がカートに商品を追加したカテゴリを含めます。       |
| Show products from categories the user purchased                            | 訪問者が商品を購入したカテゴリを含めます。           |
| Interacted with products                                                    | ユーザーが以前に操作した商品を表示します。           |
| Don't show products from the wishlist                                       | "wishlist" としてマークされたアイテムを除外します。 |
| Show only products that fill up the user's cart to a specified value        | 最低カート値に到達するのに役立つ商品を推奨します。       |
| Show from categories from which the user has added products to the wishlist | ウィッシュリストアクティビティに関連するカテゴリを含めます。  |
| Show products that match a parameter value of the current product           | 現在の商品の属性（例：色やサイズ）と一致させます。       |
| Show products matching the values of the selected parameter                 | 商品間で共有されるパラメータ値でフィルタリングします。     |
| Don't show products that match a parameter value of the current product     | 現在の商品とパラメータを共有する商品を除外します。       |
| Show products that match the brand of the current product                   | 同じブランドのアイテムを表示します。              |
| Show products from the same department                                      | 結果を同じ部門に制限します。                  |
| Don't show selected products                                                | 特定の商品を手動で除外します。                 |
| Show only products with price                                               | 価格が設定されているアイテムのみを表示します。         |
| Show products available in specified quantity                               | 在庫レベルでフィルタリングします。               |
| Show only statistically related products                                    | 統計的に強い相関関係を持つ商品を表示します。          |
| Show products with a given margin                                           | 利益マージンに基づいてフィルタリングします。          |
| Show only products of selected brands                                       | 選択したブランドに結果を制限します。              |
| Don't show products of selected brands                                      | 特定のブランドを除外します。                  |
| Discount products                                                           | 割引商品のみを含めます。                    |
| Discount value                                                              | 割引率または値のしきい値を設定します。             |
| Skip niche algorithms                                                       | ニッチベースのロジックを省略します。              |
| Exclude products of the same group                                          | 同じグループのアイテムを推奨しないようにします。        |
| Show products with only gender                                              | 性別関連の属性でフィルタリングします。             |
| Show products marked as new arrivals                                        | 新着商品を含めます。                      |
| Sort by rating                                                              | ユーザー評価で商品を並べ替えます。               |
| Do not show from categories in which the user has viewed products           | 訪問者が閲覧したカテゴリを除外します。             |
| Do not show products from categories the user purchased                     | 訪問者が購入したカテゴリを除外します。             |
| Don't exclude previously purchased products                                 | 以前に購入した商品を含めます。                 |
| Don't exclude already in-cart products                                      | 既に訪問者のカートにある商品を含めます。            |
| Show products of selected merchants only                                    | 選択したマーチャントに結果を制限します。            |
| Don't show products of selected merchants                                   | 選択したマーチャントを除外します。               |
| Show products of merchants of the current product                           | 現在の商品のマーチャントと一致させます。            |
| Show products that match the rating                                         | 特定の評価と一致する商品を含めます。              |
| Don't show products that match the rating                                   | 特定の評価の商品を除外します。                 |
| Do not show products from categories that the user added to cart            | カート追加に関連するカテゴリを除外します。           |
| By profit                                                                   | 収益基準でフィルタリングします。                |

#### ユースケースの例

条件とフィルタを組み合わせて、洗練されたマーチャンダイジングシナリオを作成できます。

**例:**

* **Condition:** 現在の商品が \$100 を超える場合 → 「Popular products」アルゴリズムを使用します。
* **Filter（Popular products に対して）:** ユーザーが購入したカテゴリの商品のみを表示します。

条件が満たされない場合、Kameleoon は次のアルゴリズムに移動します。
