Working with multi-value attributes in inclusion rules
Example: Exclude recently watched items
Suppose that you want to prevent any movies that are in the user’s last ten watched movies from being recommended. First, write a profile script called user.lastWatchedMovies
to track the last ten viewed movies as a JSON array. Then, you can exclude the items by using the following inclusion rule:
`Profile Attribute Matching`
`id - is not contained in list - user.lastWatchedMovies`
JSON API representation of the inclusion rule:
{
"attribute": "id",
"operation": "isNotContainedInList",
"source": {
"name": "user.lastWatchedMovies",
"type": "PROFILE"
}
}
Example: Recommend items from the user’s favorites
Suppose that you want to recommend tickets only to concerts if the band playing is one of the user’s favorite bands. First, ensure that you have a profile variable called profile.favoriteBands
that contains the user’s favorite bands. Then, ensure that your catalog includes an attribute entity.artistPerforming
that includes the artist performing in the concert. Then, you can use the following inclusion rule:
`Profile Attribute Matching`
`artistPerforming - is contained in list - profile.favoriteBands`
JSON API representation of the inclusion rule:
{
"attribute": "artistPerforming",
"operation": "isContainedInList",
"source": {
"name": "profile.favoriteBands",
"type": "PROFILE"
}
}
Example: API creation of criteria recommending items from a user’s favorites
Criteria using multi-value filtering rules, like all criteria, can be created via Adobe Target APIs. An example API call to create a criteria where the entity attribute id
is contained in the mbox parameter list favorites
is provided here:
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"
}
}
]
}
}'
This would be paired with JavaScript on the page to pass in the favorites contents:
<!-- 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>
Adobe Target Maturity Webinar Series
Adobe Customer Success Webinars
Tuesday, Feb 4, 4:00 PM UTC
Adobe Target innovations, including GenAI, and best practices on AI-powered personalization and experimentation at scale.
Register