このページ:では、Adobe Target Recommendations カタログの項目を説明する単一および複数値のカスタムエンティティ属性を定義、送信、使用する方法について説明します。
Adobe Target Recommendationsで単一および複数値のカスタムエンティティ属性を使用して、カタログ内のアイテムに関する追加情報を定義します。 この情報は、アルゴリズムの包含ルール、カタログルール、除外ルールで使用でき、デザインに表示できます。
制限
最大 100 個のカスタムエンティティ属性を使用して、カタログの項目に関する追加情報を定義することができます。 例えば、entity.genre という名前のカスタム属性を作成して、書籍や映画を定義できます。 また、チケット業者はイベントが開催される施設の属性を作成して、スポーツイベントでの来訪チームやコンサートの前座など第 2 のパフォーマーを追加することができます。
単一値のカスタムエンティティの属性の最大長は、15,000 文字(英語やその他のラテン文字のアルファベットなどの 1 バイトおよび 2 バイトの UTF-8 でエンコードされた言語の場合)、または 10,000 文字(中国語、日本語、韓国語などの 3 バイトの UTF-8 エンコード言語の場合)です。
複数値のカスタムエンティティ属性には、500 個以下の値を含めることができます。 個々の値はそれぞれ 100 文字以内に制限されています。 すべての値の合計文字数は、単一値エンティティのカスタム属性の最大長の制限に準拠する必要があります(上記を参照)。
カスタムエンティティ属性値
カスタムエンティティ属性には、単一値または複数値を設定できます。 エンティティ属性値は製品表示で表示されます。
単一値のカスタムエンティティ属性は、単一値の定義済みエンティティ属性と同じように構成されます。
entity.genre=genre1
複数値のカスタムエンティティ属性は、有効な JSON 配列として送信する必要があります。
entity.genre=["genre1", "genre2"]
Recommendations で使用できる有効な JSON 配列の例を以下に示します。
["AB","BC"]すべての値が文字列[1,2]すべての値が数値
["AB",1,true, [1,2,3]] は有効な JSON 配列ではありますが、値の種類(文字列、数値、ブール値、オブジェクト)が混在しているので、Recommendations では使用できません。カスタム属性は、有効な JSON 配列として送信されると、カタログ内のすべての製品について複数値の属性として扱われます。
制限事項:
- 事前定義されたエンティティの属性名はカスタムエンティティの属性に使用できません。 (エンティティ属性を参照。)
- 属性
entity.environmentはシステムによって予約されており、カスタムエンティティの属性には使用できません。entity.environment、フィードまたは API を使用してtargetPageParamsを渡そうとしても無視されます。 - 配列には単一値が含まれている必要があります。 値の種類が混在する配列(
["AB",1,true])は使用できません。 - 複数値の属性で入れ子になっている JSON 配列(
[10,12,[1,2,3]])は単一値の属性として扱われます。
複数値の属性の実装
フィード (CSV)、targetPageParams、および配信APIを使用して製品をアップロードする場合、複数値のカスタムエンティティ属性がサポートされます。 新しい値によって現在の値は置き換えられます。新しい値が現在の値の後には追加されることはありません。 空の配列([])は、値がないとして扱われます。
二重引用符は、エスケープする必要があります。 例えば、"[""test"", ""value""]" は CSV で使用できる有効な JSON 配列です。
targetPageParamsの使用
次の例は、targetPageParamsの使用方法を示しています。
CSVの使用
CSV ファイルの管理は、テキストエディターで生データの形式でおこなうか、スプレッドシートソフトウェアを利用します。
この生データの CSV は次のような形式です。
このカタログはスプレッドシートでは次のようになります。
スプレッドシートソフトウェアは、.csv 形式に変換する際に、セルの内容に二重引用符を追加します。これにより、セル内のコンマが列区切り記号として認識されることを防ぎます。 また、複数値のカスタム属性に含めた JSON 文字列値の前後にも二重引用符が追加されます。 このため、生データのファイルを直接編集することはお勧めできません。 次に例を示します。
- スプレッドシート:
["1","2","3"] - 生データ:
"[""1"",""2"",""3""]"
生のカタログ CSV ファイルを直接編集する場合は注意してください。
APIの使用
mbox パラメーターの配信APIを使用して、エスケープされたJSON配列を含む文字列値として複数値属性を渡すことができます。
配信および保存エンティティ APIの使用について詳しくは、Adobe Recommendations API ドキュメント を参照してください。
複数値の属性を持つ演算子の使用
アルゴリズムインクルージョンルール、カタログルール、エクスクルージョンルールで複数値のカスタム属性に演算子を適用する場合、リストの値のうち少なくとも 1 つが演算を通過する場合(ブール演算子 OR)、結果は true になります。
次の例では、ルールはmessage contains abcです。
- 例 1:
entity.genre = ["ab", "bc", "de"]。 結果は false になります。どの値にもabcは含まれていません。 - 例 2:
entity.genre = ["abcde","de","ef"]。 結果は true になります。1 つの値にabcが含まれています。
否定演算子の場合、すべての属性値が通過する必要があります(ブール演算子 AND)。 例えば、演算子がnotEqualsの場合、値が一致する場合、結果は false になります。
次の表に、各演算子の動作を示し、各ルールの例を示します。
| 演算子 | 次の場合、結果はtrueです | ルールの例 | 属性値 | 結果 | 理由 |
|---|---|---|---|---|---|
| 次と等しい | 任意の属性値が入力値に等しい。 | genre equals abc | ["ab", "bc", "de"] | False | abcに等しい値はありません。 |
["abc", "de", "ef"] | True | 1つの値はabcに等しいです。 | |||
["abcde", "de", "ef"] | False | abcは、リスト内のどの要素にも等しくありません。 | |||
| 次と等しくない | 属性値が入力値に等しい場合はありません。 | genre not equals abc | ["ab", "bc", "de"] | True | abcに等しい値はありません。 |
["abc", "de", "ef"] | False | 1つの値はabcに等しいです。 | |||
["abcde", "de", "ef"] | True | abcは、リスト内のどの要素にも等しくありません。 | |||
| 次を含む | 任意の属性値には、入力値が含まれます。 | genre contains abc | ["ab", "bc", "de"] | False | 値にabcが含まれていません。 |
["abcde", "de", "ef"] | True | 1つの値にabcが含まれています。 | |||
| 次を含まない | 属性値に入力値が含まれていません。 | genre does not contain abc | ["ab", "bc", "de"] | True | 値にabcが含まれていません。 |
["abcde", "de", "ef"] | False | 1つの値にabcが含まれています。 | |||
| 次の語句で始まる | 任意の属性値は、入力値で始まります。 | genre starts with abc | ["ab", "bc", "de"] | False | abcで始まる値はありません。 |
["abcde", "de", "ef"] | True | 1つの値はabcで始まります。 | |||
["ab", "de", "abc"] | True | 1つの値がabcで始まります(必ずしもリストの最初の要素ではありません)。 | |||
| 次の語句で終わる | 任意の属性値は入力値で終わります。 | genre ends with abc | ["ab", "bc", "de"] | False | abcで終わる値はありません。 |
["deabc", "de", "ef"] | True | 1つの値はabcで終わります。 | |||
| 次よりも大きいか等しい(数値のみ) | 任意の属性値が入力値以上である。 各値はdoubleに変換され、変換できない値はルールの実行中にスキップされます。 | price greater than or equal to 100 | ["10", "20", "45", "de"] | False | 100以上の値はありません。 「de」は倍精度に変換できないためスキップされています。 |
["100", "101", "90", "80"] | True | 2つの値が100以上です。 | |||
| 次よりも小さいか等しい(数値のみ) | 任意の属性値が入力値以下である。 各値はdoubleに変換され、変換できない値はルールの実行中にスキップされます。 | price less than or equal to 100 | ["101", "200", "141", "de"] | False | 100以下の値はありません。 「de」は倍精度に変換できないためスキップされています。 |
["100", "101", "90", "80"] | True | 2つの値が100以下です。 | |||
| 動的に一致(項目ベースのアルゴリズムの場合のみ) | 任意の属性値が入力値と一致します。 | genre matches abc | ["ab", "bc", "de"] | False | abcに一致する値はありません。 |
["abc", "de", "ef"] | True | 1つの値がabcに一致します。 | |||
| 動的に一致しない(項目ベースのアルゴリズムでのみ使用可能) | 入力値と一致する属性値はありません。 任意の属性値が一致する場合、結果はfalseになります。 | genre does not match abc | ["ab", "bc", "de"] | True | abcに一致する値はありません。 |
["abc", "de", "ef"] | False | 1つの値がabcに一致します。 | |||
| 動的な範囲にある(項目ベースのアルゴリズムでのみ使用可能、数値のみ) | 任意の数値属性値は、指定した範囲内にあります。 | price dynamically ranges in 80% to 120% of 100 | ["101", "200", "125", "de"] | True | 101は100の80%から120%の範囲です。 「de」は倍精度に変換できないためスキップされています。 |
["130", "191", "60", "75"] | False | 値は80%から100%の範囲にはありません。 |
デザイン内の複数値の属性
複数値の属性は、デザインで参照する場合はコンマ区切りのリストとして表示されます。
例:
設計で entity.genre=["genre1","genre2"] が $entity<N>.genre として参照されている場合、結果は「genre1, genre2」になります。
関連トピック
AI Knowledge Reference
This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.
For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.
- TL;DR: Single- and multi-value custom entity attributes define additional information about items in the Adobe Target Recommendations catalog, and this page explains the limits, how to send them, and how operators and designs treat multiple values.
Intents:
- Define single-value and multi-value custom entity attributes for items in the catalog.
- Send a multi-value custom entity attribute as a valid JSON array.
- Implement multi-value attributes with feeds (CSV),
targetPageParams, or the Delivery API. - Predict the result of an operator applied to a multi-value custom attribute in algorithm inclusion rules, catalog rules, and exclusion rules.
- Display multi-value attributes in a design.
Glossary:
- Custom entity attribute (product-specific): an attribute that defines additional information about items in the catalog. It can be used in algorithm inclusion rules, catalog rules, and exclusion rules, and it can be displayed in designs.
- Single-value attribute: a custom entity attribute with one value, formed the same way as a single-value predefined entity attribute, for example
entity.genre=genre1. - Multi-value attribute: a custom entity attribute that contains several values and is sent as a valid JSON array, for example
entity.genre=["genre1", "genre2"]. - Double: a Java data type. For operators that require numeric values, converting to double eliminates non-numeric values from consideration in the results.
Guardrails:
- You can include up to 100 custom entity attributes.
- The maximum length of single-value entity custom attributes is 15,000 characters for one- and two-byte UTF-8 encoded languages such as English and other Latin-script alphabets, or 10,000 characters for three-byte UTF-8 encoded languages such as Chinese, Japanese and Korean.
- Multi-value entity custom attributes can contain no more than 500 values. Each individual value is limited to 100 characters. The total number of characters across all values must conform to the limitations for the maximum length of single-value entity custom attributes.
- A multi-value custom entity attribute must be sent as a valid JSON array.
- Recommendations does not support mixed value types in multi-value entity attributes. Arrays must contain a single value type. For example,
["AB",1,true]is not supported. - You cannot use predefined entity attribute names for custom entity attributes.
- The attribute
entity.environmentis reserved by the system and cannot be used for custom entity attributes. Attempts to passentity.environmentusingtargetPageParams, feeds, or APIs will be ignored. - After a custom attribute is sent as a valid JSON array, the attribute is treated as a multi-value attribute for all products in the catalog. To change an attribute from multi-value to single-value, you must delete your catalog and upload corrected product data. Deleting your catalog does not delete the historical data associated with your product IDs.
- When implementing multi-value attributes, double quotes must be escaped.
Applicability:
- Multi-value custom entity attributes are supported when using feeds (CSV),
targetPageParams, and the Delivery API to upload products. - The operators Dynamically matches, Dynamically does not match, and Dynamically ranges are only available in item-based algorithms.
- The operators Greater than or equal to, Less than or equal to, and Dynamically ranges apply to numeric values only.
Terminology:
- Canonical name: Custom entity attributes (the page also writes “custom attribute”, “entity custom attributes” and, for multi-value, “multi-valued custom attributes”).
- Product name: Adobe Target Recommendations (written “Recommendations” in the body).
- Variants: “single-value” and “multi-value” custom entity attributes.
FAQ:
- How do I send a multi-value custom entity attribute? Send it as a valid JSON array, for example
entity.genre=["genre1", "genre2"]. In a Delivery API mbox parameter, pass it as a string value containing an escaped JSON array. - What happens when I send new values for a multi-value attribute? New values replace current values; they are not appended. Empty arrays ( [] ) are treated as having no values.
- How does an operator work on a multi-value custom attribute? The result is true if at least one value in the list passes the operation (boolean or). For negative operators, all attribute values must pass (boolean and); for example, with the operator
notEquals, the result is false if any value matches. - What happens to values that cannot be converted to double? For operators that require numeric values, each value is converted to double, and values that cannot be converted are skipped while the rule runs.
- How does a multi-value attribute appear in a design? It appears as a comma-separated list when referenced in a design.
- Where are entity attribute values displayed? Entity attribute values are displayed in the product view.
Examples:
- Valid JSON arrays supported by Recommendations:
["AB","BC"](all values are strings) and[1,2](all values are numeric). targetPageParamsexample of sending a multi-value attribute:'entity.MultiValueAttribute': '["X", "Y", "Z"]'.- CSV example of a valid JSON array with escaped double quotes:
"[""test"", ""value""]". Spreadsheet software shows["1","2","3"], while the raw file shows"[""1"",""2"",""3""]". - Delivery API example of sending a multi-value attribute in an mbox parameter:
"entity.MultiValueAttribute": "[\"X\", \"Y\", \"Z\"]". - Rule
message contains abc: withentity.genre = ["ab", "bc", "de"]the result is false because no value containsabc; withentity.genre = ["abcde","de","ef"]the result is true because one value containsabc. - Rule
genre not equals abc: with["abc", "de", "ef"]the result is false because one value is equal toabc; with["ab", "bc", "de"]the result is true. - Rule
price greater than or equal to 100with["10", "20", "45", "de"]: the result is false, and the valuedeis skipped because it cannot be converted to double. - Design reference: when
entity.genre=["genre1","genre2"]is referenced in a design as$entity<N>.genre, the result isgenre1, genre2.
Best practices:
- Use caution when editing a raw catalog CSV file directly, because spreadsheet software adds double quotation marks around JSON string values in custom multi-value attributes, which can make working directly with the raw file unwieldy.
Related pages:
- Predefined entity attribute names that cannot be used for custom entity attributes: Entity Attributes (c-recommendations/c-products/entity-attributes.md)
Personas:
- developer: Can send multi-value custom entity attributes with feeds (CSV),
targetPageParams, and the Delivery API. With the Delivery API, they are passed in an mbox parameter as a string value containing an escaped JSON array. Double quotes must be escaped. The page states that new values replace current values and are not appended. Where: “Implementing multi-value attributes”. - marketer: Can apply operators to multi-valued custom attributes in algorithm inclusion rules, catalog rules, and exclusion rules, where the result is true if at least one value passes the operation. The page states that for negative operators, all attribute values must pass. Where: “Using operators with multi-value attributes”.
Onboarding:
- Level: Intermediate, Experienced
- First minimal step: Send a multi-value custom entity attribute as a valid JSON array, for example
entity.genre=["genre1", "genre2"]. - Previous: Check predefined entity attribute names that cannot be used for custom attributes: Entity Attributes (c-recommendations/c-products/entity-attributes.md)