複数値の属性の扱い multi-value-attributes

このページ:​では、複数値データをAdobe Target Recommendationsに送信する方法と、複数値の演算子を含めるルールで使用する方法について説明します。

複数値フィールドには、同じ項目または訪問者に対して複数の値が保持されます。 次に例を示します。

  • ユーザーに提供される映画:特定の映画には複数の俳優が含まれます。
  • コンサートのチケット販売:特定のユーザーには複数のお気に入りのバンドがあります。
  • 衣料品販売:シャツは複数のサイズで利用できます。

これらのシナリオでレコメンデーションを処理するには、複数値データをTarget Recommendationsに渡し、特殊な複数値の演算子で使用します。

複数値データの送信 send

Recommendationsが多値データを識別できるようにするには、JSON配列として送信する必要があります。

JavaScript (targetPageParams)の複数値パラメーターについては、複数値の属性の実装を参照してください。

CSV ファイルでは、次のサンプルのように、複数値のエンティティ属性が、属性のセル内のJSON配列として送信されます。

複数値の属性を持つCSV ファイルの例
code language-none
## RECSRecommendations Upload File,,,,,,,,,,,,,,,,,,,
## RECS''## RECS'' indicates a Recommendations pre-process header. Please do not remove these lines.,,,,,,,,,,,,,,,,,,,
## RECS,,,,,,,,,,,,,,,,,,,
## RECSUse this file to upload product display information to Recommendations. Each product has its own row. Each line must contain 19 values and if not all are filled a space should be left.,,,,,,,,,,,,,,,,,,,
## RECSThe last 100 columns (entity.custom1 - entity.custom100) are custom. The name 'customN' can be replaced with a custom name such as 'onSale' or 'brand'.,,,,,,,,,,,,,,,,,,,
## RECSIf the products already exist in Recommendations then changes uploaded here will override the data in Recommendations. Any new attributes entered here will be added to the product''s entry in Recommendations.,,,,,,,,,,,,,,,,,,,
## RECSentity.id ,entity.name,entity. categoryId ,entity. message ,entity.thumbnailUrl ,entity.value ,entity.pageUrl ,entity.inventory ,entity.margin ,entity.custom1 ,entity.custom2 ,entity.custom3 ,entity.custom4,entity.custom5,entity.custom6,entity.custom7,entity.custom8,entity.custom9,entity.custom10,
1,Sample Product 1,category1,Save 10%,http://sample.store/products/images/product1_th.jpg,325,http://sample.store/products/product_detail.jsp?productId=1,1000,48,a,"[ ""v1"", ""v2"" ]",, , , , , , , ,
2,Sample Product 2,category1,Save 10%,http://sample.store/products/images/product2_th.jpg,369,http://sample.store/products/product_detail.jsp?productId=2,1000,52,a,"[ ""v1"", ""v2"" ]",, , , , , , , ,
3,Sample Product 3,category1,Save 10%,http://sample.store/products/images/product3_th.jpg,479,http://sample.store/products/product_detail.jsp?productId=3,1000,78,a,"[ ""v1"", ""v2"" ]",,,,,,,,,
4,Sample Product 4,category1,Save 10%,http://sample.store/products/images/product4_th.jpg,409,http://sample.store/products/product_detail.jsp?productId=4,1000,66,a,"[ ""v1"", ""v2"" ]",,,,,,,,,
5,Sample Product 5,category1,Save 10%,http://sample.store/products/images/product5_th.jpg,325,http://sample.store/products/product_detail.jsp?productId=5,1000,45,a,"[ ""v1"", ""v2"" ]",,,,,,,,,

エンティティ属性、プロファイル属性、またはmbox パラメーターがこの形式で複数値として提供されると、Recommendationsはフィールドが複数値であると自動的に推測します。

包含ルールで複数値属性を使用する multi-value-inclusion-rules

複数値のエンティティ、プロファイルおよびmbox属性で使用できる演算子は次のとおりです。

  • はリスト​に含まれています
  • はリスト​に含まれていません
NOTE
複数の値の属性に対する動的マッチングのサポートは、現在、左側の単一の値を右側の複数の値と比較するプロファイル属性マッチングまたはパラメーター(mbox)属性マッチングルールを使用する条件でのみ利用できます。 複数値の属性は、現在、プロモーション、エンティティ属性の一致、または包含ルールの左側のリストではサポートされていません。

例:最近視聴した項目を除外

ユーザーの最後の10本の視聴済み映画の映画が推奨されないようにするには、最初に、最後の10本の視聴済み映画をJSON配列として追跡するuser.lastWatchedMoviesというプロファイルスクリプトを作成します。 次の包含ルールを使用して、項目を除外できます。

Profile Attribute Matching
id - is not contained in list - user.lastWatchedMovies

包含ルールのJSON API表現:

{
    "attribute": "id",
    "operation": "isNotContainedInList",
    "source": {
        "name": "user.lastWatchedMovies",
        "type": "PROFILE"
    }
}

例:ユーザーのお気に入りから商品をレコメンドする

バンドの演奏がユーザーのお気に入りのバンドの1つである場合にのみコンサートチケットを推薦するには、ユーザーのお気に入りのバンドを含むprofile.favoriteBandsというプロファイル変数と、コンサートで演奏するアーティストを含むカタログ内の属性entity.artistPerformingの2つの項目が必要です。 次の包含ルールを使用できます。

Profile Attribute Matching
artistPerforming - is contained in list - profile.favoriteBands

包含ルールのJSON API表現:

{
    "attribute": "artistPerforming",
    "operation": "isContainedInList",
    "source": {
        "name": "profile.favoriteBands",
        "type": "PROFILE"
    }
}

例:ユーザーのお気に入りからの項目を推奨する基準のAPI作成

複数値フィルタリングルールを使用する条件は、すべての条件と同様に、Adobe Target APIを通じて作成できます。 次のAPI呼び出しの例では、エンティティ属性idがmbox パラメーターリスト favoritesに含まれる条件を作成します。

curl -X POST \
  https://<serverhost>/api/recs/<client>/criteria/item \
  -H 'Accept: application/vnd.adobe.target.v1+json' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'User-Agent: <from API client>' \
  -H 'X-Target-user-email: <email address>' \
  -H 'cache-control: no-cache' \
  -d '{
    "name": "viewed criteria",
    "criteriaTitle": "test title",
    "type": "VIEWED_CF",
    "key": "CURRENT",
    "daysCount": "TWO_WEEKS",
    "aggregation": "NONE",
    "backupDisabled": false,
    "partialDesignAllowed": true,
    "configuration": {
        "inclusionRules": [
            {
                "attribute": "id",
                "operation": "isContainedInList",
                "source": {
                    "name": "mbox.favorites",
                    "type": "MBOX"
                }
            }
        ]
    }
}'

この呼び出しは、お気に入りの内容を渡すページ上のJavaScriptと組み合わせられます。

<!-- pass in the value of mbox parameter "favorites" as JSON array -->
<script type="text/javascript">
   mboxCreate('myMbox','entity.id=<key>','favorites=["a","b","c"]');
</script>
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: Explains how to send multi-value data to Adobe Target Recommendations and how to use it in inclusion rules with the multi-value operators.

Intents:

  • Understand what a multi-value field is and when to use one.
  • Send multi-value data to Target Recommendations as a JSON array, including in a CSV file.
  • Use the operators is contained in list and is not contained in list in inclusion rules.
  • Exclude recently watched items from recommendations with a profile script.
  • Recommend items from the favorites of a user.
  • Create criteria that use multi-value filtering rules through the Adobe Target APIs.

Glossary:

  • Multi-value field: a field that holds several values for the same item or visitor.
  • is contained in list (product-specific): an operator available for multi-value entity, profile, and mbox attributes.
  • is not contained in list (product-specific): an operator available for multi-value entity, profile, and mbox attributes.

Guardrails:

  • Support for dynamic matching to multi-value attributes is currently available only in criteria that use a profile attribute matching or parameter (mbox) attribute matching rule that compares a single value on the left side to a multi-value on the right side.
  • Multi-value attributes are not currently supported in promotions, entity attribute matching, or for lists on the left side of inclusion rules.

Terminology:

  • Canonical name: multi-value attributes (variants: multi-value field, multi-value data)
  • Product name: Adobe Target Recommendations (variants: Target Recommendations, Recommendations)

FAQ:

  • How does Recommendations identify multi-value data? It should be sent as a JSON array, and when an entity attribute, profile attribute, or mbox parameter is provided as multi-value in this format, Recommendations automatically infers that the field is multi-value.
  • How is a multi-value entity attribute sent in a CSV file? As a JSON array in the cell of the attribute.
  • Which operators can be used with multi-value entity, profile, and mbox attributes? is contained in list and is not contained in list.
  • Can multi-value attributes be used in promotions? No, multi-value attributes are not currently supported in promotions.
  • Can criteria that use multi-value filtering rules be created through the APIs? Yes, they can be created through the Adobe Target APIs, like all criteria.

Examples:

  • Exclude recently watched items: to prevent any movies in the last ten watched movies of the user from being recommended, write a profile script called user.lastWatchedMovies that tracks the last ten viewed movies as a JSON array, then use the inclusion rule Profile Attribute Matching id - is not contained in list - user.lastWatchedMovies. Its JSON API representation uses the operation isNotContainedInList with a source of type PROFILE.
  • Recommend items from the favorites of the user: to recommend concert tickets only when the band playing is one of the favorite bands of the user, two items are required, a profile variable called profile.favoriteBands and an attribute entity.artistPerforming in the catalog. The inclusion rule is Profile Attribute Matching artistPerforming - is contained in list - profile.favoriteBands. Its JSON API representation uses the operation isContainedInList with a source of type PROFILE.
  • API creation of criteria recommending items from the favorites of a user: an API call to https://<serverhost>/api/recs/<client>/criteria/item creates a criteria where the entity attribute id is contained in the mbox parameter list favorites (operation isContainedInList, source of type MBOX). This call is paired with JavaScript on the page that passes in the content of the favorites with mboxCreate, as a JSON array.
  • Scenarios for a multi-value field: movies offered to users (a given movie has multiple actors), tickets sold for concerts (a given user has multiple favorite bands), clothing sold (a shirt is available in multiple sizes).

Related pages:

  • For a multi-value parameter in JavaScript (targetPageParams): Implementing multi-value attributes (c-recommendations/c-products/custom-entity-attributes.md)

Personas:

  • marketer: Can use the operators is contained in list and is not contained in list with multi-value entity, profile, and mbox attributes in inclusion rules. The page states that support for dynamic matching to multi-value attributes is currently available only in criteria that use a profile attribute matching or parameter (mbox) attribute matching rule that compares a single value on the left side to a multi-value on the right side. Where: “Use multi-value attributes in inclusion rules”.
  • developer: Can send multi-value data to Recommendations as a JSON array, send a multi-value entity attribute in a CSV file as a JSON array in the cell of the attribute, and create criteria that use multi-value filtering rules through the Adobe Target APIs. The page states that Recommendations automatically infers that the field is multi-value when an entity attribute, profile attribute, or mbox parameter is provided in this format. Where: “FAQ”.

Onboarding:

  • Level: Intermediate, Experienced
  • First minimal step: Send multi-value data to Recommendations as a JSON array.
recommendation-more-help
target-help-main