インクルージョンルールでの複数値の属性の使用
複数値の属性に対する動的な一致は、現在、単一の値の左側と複数値の右側を比較する際に、プロファイル属性の一致またはパラメーター(mbox)属性の一致ルールを使用する場合の条件でのみサポートされています。 複数値の属性は、現在、プロモーション、エンティティ属性のマッチング、包含ルールの左側のリストではサポートされていません。
例:最近監視した項目を除外する
例えば、ユーザーが最後に視聴した 10 本のムービーに含まれるムービーをレコメンデーションできないようにするとします。 まず、「user.lastWatchedMovies
」という名前のプロファイルスクリプトを作成して、最後に閲覧された 10 本のムービーを JSON 配列として追跡します。 次に、以下のインクルージョンルールを使用して項目を除外できます。
`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
がカタログに含まれていることを確認します。 次に、以下のインクルージョンルールを使用できます。
`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 を使用して作成できます。 エンティティ属性 id
が mbox パラメーターリスト favorites
に含まれている条件を作成するための API 呼び出しの例を以下に示します。
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>